Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Implement checkbox option for individual file in search result panel. #8260

Merged
merged 8 commits into from
Jul 18, 2014

Conversation

RaymondLim
Copy link
Contributor

@larz0 Checkboxes for files are not aligned with others, can you take a look?

@larz0
Copy link
Member

larz0 commented Jun 26, 2014

@RaymondLim np, checking it out now.

@RaymondLim
Copy link
Contributor Author

@larz0 I don't see your changes. Are you committing to this branch?

@larz0
Copy link
Member

larz0 commented Jun 26, 2014

@RaymondLim it's pretty small so I'll just push to this branch, give me 10 mins.

@larz0
Copy link
Member

larz0 commented Jun 26, 2014

@RaymondLim ok done.

@RaymondLim
Copy link
Contributor Author

Looks great! Thanks @larz0.

@@ -2,6 +2,7 @@
<tbody>
{{#searchList}}
<tr class="file-section" data-file-index="{{fileIndex}}">
{{#replace}}<td class="checkbox-column"><input type="checkbox" class="check-one-file" {{#isChecked}}checked="true"{{/isChecked}} /></td>{{/replace}}
<td colspan="{{#replace}}3{{/replace}}{{^replace}}2{{/replace}}">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong now and it might be the reason of the misalignment. It should 2 in both cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @TomMalbran. Will push a change soon.

@redmunds
Copy link
Contributor

Triage Complete

@redmunds redmunds self-assigned this Jul 17, 2014
@redmunds
Copy link
Contributor

When collapsing (using the triangle icon) the last file, a left margin is introduced. I verified that this does not happen in master.

Before:

file-checkbox1

After:

file-checkbox2

@redmunds
Copy link
Contributor

When all items for a file are checked on and I toggle off one of them, then the checkbox for file is turned off (as I expected). When I toggle the same item back on (so all items for file are checked), I expected that the checkbox for file would be turned back on, but it wasn't. Not sure how hard that would be to implement, but I think it would be nice to have.

I see similar behavior with "header" checkbox that controls all files & items.

Another unexpected behavior with header checkbox: If all checkboxes are on, and I toggle off 1 item, then header checkbox is turned off. But, if all checkboxes are turned on and I toggle off a file, the header checkbox stays on.

@RaymondLim
Copy link
Contributor Author

@redmunds I agree with you regarding to turn back on the checkbox when all items in a file are checked. You can observe the same anomaly with the checkbox in the title. I'll try to work on both.

@redmunds
Copy link
Contributor

@RaymondLim I added another case to this comment, so please re-read.

@redmunds
Copy link
Contributor

When all checkboxes under a file or header are checked, the checkbox is on. If any checkbox under a file or header are off, then the checkbox is off.

I haven't tried it, but there is an indeterminate state that could possibly be used in the case where some checkboxes are on and some are off to give user more feedback. This is helpful when the number of items under a file or header exceeds height of panel and you can't see them all at once.

@redmunds
Copy link
Contributor

Done with initial review.

@RaymondLim
Copy link
Contributor Author

@redmunds I just implement the following three cases that you mentioned.

  • Check parent File checkbox if the last unchecked child is checked.
  • Check header checkbox if the last unchecked item is checked.
  • Check header checkbox if the last unchecked file checkbox is checked.

I did try to use indeterminate state, but it does not show the indeterminate state in Brackets. So it won't be in for this pr.

I also try to fix the indentation issue in file rows, but can't find a way to control the table layout with anything in CSS. @larz0 Can you take a look and see you can fix the table layout issue when all file nodes are collapsed?

@TomMalbran
Copy link
Contributor

@RaymondLim Adding a width to the checkbox column should fix the width issue. And since is a table , the width can even be smaller than the actual width. The same solution is used for the line numbers column to prevent the same problem.

@RaymondLim
Copy link
Contributor Author

Thanks @TomMalbran It works. I can even remove @larz0 tweak for file rows and just use width: 5px;.

@RaymondLim
Copy link
Contributor Author

@redmunds Ready for re-review.

@redmunds
Copy link
Contributor

Looks good. Merging.

redmunds added a commit that referenced this pull request Jul 18, 2014
Implement checkbox option for individual file in search result panel.
@redmunds redmunds merged commit a3195b8 into master Jul 18, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants