-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Conversation
…e, in collapsible sections. Also, remove async code from _updateSelectedMarker() (seems to be a very old remnant from when we allowed scrolling in the rule list, which we don't anymore) and stop returning a Promise (no one was using it anyway).
- properly persist collapsed sections preference (explicit layerID required) - adjust inline widget height when sections collapsed/expanded - fix bug where collapsed sections popped back open after add/remove rule - show message when all results are in collapsed sections Plus some cleanups: - document messageCB & labelCB better - remove unneeded fixed height on $relatedContainer - cleanup unused args to sizeInlineWidgetToContents()
…rouping * origin/master: (182 commits) Fix unit test failure -- file-read wasn't always passing back correct error codes anymore. If the initial stat() fails (e.g. file doesn't exist or permission denied), we were double-converting the error code from brackets-shell format to FS impl API format, causing it to get mangled and treated as "Unknown." Limit document file sizes to 16MB on open fix definePreference auto-install extensions Updated .not-editor styling based on @TomMalbran's feedback. Added subtle border for dark menus. Pushing sidebar icons to the back of Working Files label when they overlap. Project dropdown toggle needs right margin. Making sure that the anchors in jstree will never show a hover state. Fix live dev highlight being out of place in edge cases Fix for #9545. Made unfocused pane look unfocused. Initial commit. Added necessary properties in order to override bootstrap styles. This branch is for #7887. Recognize Vagrantfile as ruby Replace HTML entity with literal dash in Getting Started Update strings.js Update strings.js Fix bug #9511 (Can't select text in Extension Manager anymore) - Remove no-focus from dialog root to allow text selection. Change scope of key listener so tabbing continues to work without needing to reintroduce tabIndex on the dialog, since that triggers Bootstrap-modal problems (#9196). corrected typo in 'bootstrapping' Working Performance Set Improvements ...
…th & filename within each half. Share sorting code with New Rule dropdown & Find in Files. This changes the FiF sort order to place less-nested files higher instead of lower; and changes the New Rule sort order so folders dominate instead of filenames (placing sibling files adjacent, instead of files with the same name in very different folders). - Fix unit tests to account for new sorting behavior (should fix some tests that failed sporadically before due to nondeterministic rule list order) and for new DOM structure (file-header <li>s). - Show full path in file heading tooltip. - If newly added rule is in a collapsed item, expand it for clarity. - Exception to logic that skips collapsed groups when picking the initially selected result: If there's only one result, select it even if in collapsed file - since the rule list is hidden for single results, there's no way to expand & select it otherwise. - Fix an old but seemingly harmless bug in containsClick().
Unit tests added -- now all the code is up & ready for review |
@larz0 I haven't done a ton of polish on the section header appearance. Here's what it looks like currently: Two changes we might want to consider:
|
had some dead code after earlier cleanups in the Quick Edit grouping work) - Add unit tests for collapsed groups & add new checks to some existing tests
c569bec
to
8687f61
Compare
What about |
What is the default file processing/display order? Now that styles are grouped by file, it seems like files should have a predictable order (maybe even same sort order as file tree?). For example, I have a version of the citrus cafe site that I converted to LESS. The css folder has desktop.less, phone.less, and tablet.less files. I have an extension that auto-compiles each .less file into a .css stylesheet on save. I expected the files would be ordered by name, but they're in this order:
UPDATE: I see that you are explicitly sorting .css files last -- why is that? I'd much rather have files grouped by name (and then .css last if you think that's important):
|
Since file list takes up more space vertically, what do you think about supporting Ctrl-click on arrows to collapse-all/expand-all to quickly close files you are not interested in? |
If all files are collapsed so no matches are displayed and I expand a file, I would expect the first rule in file to automatically become selected. |
} else if (!aIsCSS && bIsCSS) { | ||
return -1; | ||
} else { | ||
return FileUtils.comparePaths(a.fullPath, b.fullPath); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, the next version of JSLint flags an error when there is no default return statement (which I generally agree with), so I think this should be changed to:
if (aIsCSS && !bIsCSS) {
return 1;
} else if (!aIsCSS && bIsCSS) {
return -1;
}
return FileUtils.comparePaths(a.fullPath, b.fullPath);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's one of the reasons we chose not to update to that version :-) Personally, I prefer the structure the way it is so all return cases have matching indent...
@peterflynn looks good here, just need to tweak the padding a tiny bit:
We should also make the changes you suggested. |
@redmunds Re the sort order, this is described at the top: we now use the same sort order as Find in Files. In general items are sorted by folder, then by name within folders. Folder relationships seem more important in telling us which items are related than naming alphabetization, IMHO. I talked to @njx about that and he seemed to think it was a good change to. Do you feel strongly it should go back to the old order where we sort by name and ignore the folder structure? We also specifically push CSS files to the bottom of the list. That's definitely by design -- in a project that contains preprocessor files, any CSS files are very likely to be generated code that you never edit directly. So we want to push those down to the bottom consistently. |
We could also list the full project-relative path of each item in the New Rule dropdown -- that might help make the sort ordering more clear. |
@peterflynn I agree with grouping files by folder and sorting .css files last. Current sorting within a folder is file type first then file name. I'd prefer sorting within a folder to be by file name first then file type. This is to group preprocessor files together with their generated .css files (when they're in the same folder). Then I can quickly see which .css files are "native" (better term here?) versus which are generated from preprocessor files, and also which preprocessor files are missing their generated .css files. |
} | ||
|
||
// Show/hide selection indicator if selection was in collapsed section | ||
this._updateSelectedMarker(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hiding selection indicator does not reset or remove the current selection. So when you navigate with Alt-Up/Down shortcuts you may be switching selection within the collapsed file. Not sure what is the better behavior, but switching selection without showing the selection in the list is not a good experience though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change it so that:
- Alt-Up/Down when selection is inside a collapsed group causes the group to expand again.
- Alt-Up/Down arrow otherwise skips over collapsed groups.
Sound good?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, make sense.
@redmunds Currently, it sorts CSS files completely to the bottom regardless of folder -- so the order is first by type (preprocessor vs. CSS), then by folder, then by filename. I feel pretty strongly that we don't want to mix CSS files into the list of LESS/SCSS files. If you have both in your project, you almost certainly want to ignore all of the CSS files. Grouping them all at the bottom makes it easier to ignore them than if they're interleaves all throughout the other results that you do care about. |
Re the Ctrl-click: I like that idea, but I'm a little worried about getting this landed by tomorrow AM as is, given all the other changes... mind if we leave that as a separate PR? (Which potentially might not land until 1.1) |
I don't remember that being discussed. This assumes that any project that uses a CSS Preprocessor uses it for 100% of the stylesheets. I don't think that's a safe assumption for larger sites with many contributors, or sites that use CSS 3rd party libraries or widgets. But it's getting down to the wire, so unless I hear anyone else pipe in, then I guess we'll go with this for now. |
@peterflynn I can wait for the Ctrl-click functionality -- just thought I'd throw it out there. |
…rouping * origin/master: (29 commits) - bump phantomjs version to 1.9.11 to avoid errors building brackets Provide a strong boost for upper case matches. Removed unneeded code Remove spy attached to getStyleSheetFromBrowser() Remove unused var (yay JSHint!). Handle case matches on special characters (extra boost). Make sure an item being renamed is displayed in the tree. Properly handle FS events for directory in the file tree. Stop filtering when the first match was found Use FindUtils method Code review changes Add Case Boost to StringMatch verify there's an error auto-install unit tests, bug fixes, code cleanup Proper shortcut for reload with extensions for Mac Increase Tern timeout to 30s. Remove unwanted change Remove the collapsed class Keep query and replace text when switching between Replace and Replace In Files Make Inline Widget content selectable again ...
…yet, select first result in this section With unit tests. - Quick Edit: Alt-Up/Down now skip collapsed sections (unless selection is in one, in which case the section is auto-expanded. With unit tests. - Remove ".collapsed" style from Quick Edit section headers since #9548 has removed it. Update unit tests to reflect this. - Make section header result counter font-weight: normal, not semibold - Tweak Quick Edit results list padding, per @larz0 - Fully remove defunct 'force' arg from sizeInlineWidgetToContents() - Docs tweaks for code review
@redmunds I pushed fixes for everything noncontroversial above (see commit for full list). Except that I haven't removed the filename from the individual result items yet -- still need to experiment with what looks best. It will require updating a lot of unit tests, so I don't want to commit that change until we've settled on what looks best. |
Here are some options for the rule list line numbers with filename removed: I think I like the first three the best. My only hesitation with the first one is that it pushes the rule names (the thing the user probably cares about the most) a little more to the right, resulting in more of the names being clipped. |
@peterflynn @placegraphichere I like: because it takes up less room and can only mean one thing. Real-estate in this sidebar is quiet precious. |
@larz0 I find that one a little hard to parse visually, especially since CSS selectors sometimes have a ":" near the end. Is there anything more we could do to separate it visually from the text to the left? Fixed-pt font? Semi-bold? More padding...? |
I added some padding and that seems to improve readability: @larz0 / @placegraphichere Any objections to that? |
Is line number even necessary? When you click on the selector you see the line number in the inline editor. |
redundant with the file-section header. Fix unit tests for this formatting change & make them more robust to future such changes.
Didn't hear anything, so I went ahead and pushed up the implementation in my last screenshot above. I've made the unit tests more robust though, so if we want to tweak this further it will be a much smaller change. |
@redmunds I thought about ditching them entirely, but it seemed like there's some value: (a) to see which rules might be close together vs. in widely separated parts of a file, or (b) in LESS/SCSS files to see if one result might be nested inside another (though you can't be 100% certain since we don't show the end line number). Anyway, the line number is something we've always had in the UI so far, and unlike the filename we haven't done anything in this PR to make it redundant... so I'm inclined to not rock the boat and just keep it. |
@peterflynn yeah that's looks better. Good call! |
Merging. |
Thanks @redmunds! Re the sorting thing: I mentioned it briefly before MAX but there wasn't a long discussion. I'm open to tweaking the sort order if we get feedback on it after 1.0 ships. |
_updateSelectedMarker()
, unused arg insizeInlineWidgetToContents()
, and a few other smaller things./project/folder/subfolder/foo.js
comes before/project/folder/bar.js
)... and thus any files at the project root are always listed last. This PR reverses that: shallower items are listed higher, and thus any files at the project root are always listed first.