-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Conversation
Can this be also solved by using https://developer.mozilla.org/en-US/docs/Web/CSS/calc ? |
Might want to wait until #4303 gets merged, which hopefully will be soon, since I changed the template a bit and it will now display arrows to show more results which shouldn't be hidden. Instead of calc, you can achieve similar results with box-sizing and padding. |
@TomMalbran thx, I'll give it a go with "box-sizing" after #4303 gets merged - put a watch on it. |
Sure. With |
What would happen if there are more than 100 results and the pagination stuff is added to the summary? Is hard to happen but still possible. |
You're right, it's messed up, I'll fix that in a moment or two. |
|
I was thinking of trying to use flex-box to make it work like a table (modifying the template if required to add any additional div), and only have overflow over the text. But I have to try if that works. |
Awesome. The results looks great. If we split the summary into 3 parts (before, text, after) we could make it look like: Making only the searched text overflow with ellipsis. |
Nice. Yes, I think we should just change the string, instead of the template in case a translation needs to change the order. Replacing the string to the next one and reversing the other changes (except the CSS) in the last commit should be better.
|
Wasn't sure about putting HTML into strings, ok sure thing. |
Yes, is ugly. Maybe we could use 3 strings, instead of harcoding the ". |
Actually, add the last " to the current string and have a string for the first ". |
I'm quite lost 😆 like this? |
Sorry. I changed my mind, since it does look ugly to place the html in the strings and I don't think we need to here. So for the template we could have:
And the strings would be:
Summary would be the formatted title string. |
No worries @TomMalbran , done. |
display: flex; | ||
flex-direction: row; | ||
} | ||
.flex-col(@grow: 0, @shrink: 1, @basis: auto) { |
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 flex-item
is a better name for this mixin
It looks great. I just added a few minor things. |
Ok, fixed all that. |
@@ -21,6 +21,19 @@ | |||
|
|||
/* Brackets mixins */ | |||
|
|||
/* Helpers for working with flex layouts */ | |||
/* see: https://developer.mozilla.org/en-US/docs/Web/CSS/flex */ | |||
.flex-item(@direction: row) { |
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.
This one should be flex-box
as before since is applied to the container.
Sorry I messed that up, should be ok now. |
No problem. It looks great now. Will still have to wait for the next sprint to merge it. So some time next week. |
Ok great, let me know if anything will be needed from me. |
@TomMalbran should be ok to merge now ? |
I don't think there should be a min width, I just think that we shouldn't fix UI problems after a certain min width. |
Lets merge this PR then? |
Sure, or I can merge master and fix also 4870 here if you want, can spare few minutes for that. |
If you have time, sure. If not, you can create a new PR for #4870. |
@TomMalbran can you review? |
I'll test how it looks now, code looks good. We probably shouldn't be using IDs for the summaries, but that is another issue... Want to also fix #4869 to? Since you are changing the strings and should be really easy to do? |
Sure, moment. I can remove those ID's too. |
I can't see the replace button... I also found another problem in Find in Files when you find stuff in a scope with a really long path. I guess the path should contract too. |
Also noticed the replace button, fixed now. |
Test and review the current version please, it works fine with me. I'd rather not play with any more stuff here :) |
StringUtils.htmlEscape(replaceWhat.toString()), | ||
StringUtils.htmlEscape(replaceWith.toString()), | ||
results.length, | ||
resultsString, |
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.
Do it like is done in find in files, so you can use matches here for consistency.
var summary = StringUtils.format(
Strings.FIND_REPLACE_TITLE,
results.length
(results.length > 1) ? Strings.FIND_IN_FILES_MATCHES : Strings.FIND_IN_FILES_MATCH,
results.length >= FIND_REPLACE_MAX ? Strings.FIND_IN_FILES_MORE_THAN : ""
);
Which means that you need to add an extra {2}
in FIND_REPLACE_TITLE, which could have the name FIND_REPLACE_POST_TITLE, to continue in the naming sequence you used.
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.
You will never get 0 matches, since the modal bar collapses before you can click on any button.
And there is still the issue with long scope labels. In the Brackets source go to The search text contracts, but the scope label doesn't and it should for this extreme cases. You will have to move the scope label to the template and divide the Find in Files title one more time. |
@TomMalbran that last mentioned case is now ok. I couldn't make it to preserve spaces so I had to use |
"FIND_IN_FILES_TITLE" : "\"{4}\" found {5} — {0} {1} in {2} {3}", | ||
"FIND_IN_FILES_PRE_TITLE" : "\"", | ||
"FIND_IN_FILES_MID_TITLE" : "\" found", | ||
"FIND_IN_FILES_TITLE" : "— {0} {1} in {2} {3}", |
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.
Rename this to FIND_IN_FILES_POST_TITLE
and FIND_REPLACE_POST_TITLE
or do you think that FIND_REPLACE_TITLE_PART1, FIND_REPLACE_TITLE_PART2, FIND_REPLACE_TITLE_PART3
can be more clear? If is we should use the same format on both.
Just 2 last minor Nits, and you can rebase before merging :) |
Rebased: Fix for issue 4602. Fix for issue 4602. Fixed overflow when pagination is present. Little fix for no-pagination case, so there's no space reserved for pagination. Only searched text is contracting now with ellipsis. Moved layout back to strings. Little more refactoring. Few more changes according code review. Few more changes according code review. #2 Fixes #4870 Fixed duplicate ID Remove IDs used for summaries. Fixes #4869 Refactored according to code-review. Fixes case when scope is a long filename. Minor refactoring
Done, why squashed commit shows 17 days ago and not current time? What did I do wrong? :) |
It is showing the day of the first commit. There is a way for it to show as the last commit, but I am not sure how. Looks good. Merging :) |
I don't know of a way to update the date during an interactive rebase, but you could do another (non-interactive) rebase afterwards and specify That said, if you're just squashing into a single commit, it might be easier to just do a |
thanks @njx , I'll play with the |
My go on a #4602
Please review.