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

Fix for issue 4602. #4661

Merged
merged 1 commit into from Aug 22, 2013
Merged

Fix for issue 4602. #4661

merged 1 commit into from Aug 22, 2013

Conversation

zaggino
Copy link
Contributor

@zaggino zaggino commented Aug 6, 2013

My go on a #4602
Please review.

@zaggino
Copy link
Contributor Author

zaggino commented Aug 6, 2013

Can this be also solved by using https://developer.mozilla.org/en-US/docs/Web/CSS/calc ?

@TomMalbran
Copy link
Contributor

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.

@zaggino
Copy link
Contributor Author

zaggino commented Aug 6, 2013

@TomMalbran thx, I'll give it a go with "box-sizing" after #4303 gets merged - put a watch on it.

@TomMalbran
Copy link
Contributor

Sure. With box-sizing: border-box the border and padding aren't taken into account with the width. So instead of having a width = width + padding + border + margin, width = width + margin. Use .sane-box-model mixin when using it.

@TomMalbran
Copy link
Contributor

@zaggino #4303 has landed. So you can take another look at the fix.

I am thinking that the best would be to wrap the text searched and not anything else, but that might be harder to do. Maybe splitting the summary text and place it into different elements in the summary template...

@zaggino
Copy link
Contributor Author

zaggino commented Aug 9, 2013

Works for me, just CSS changes.
image

@TomMalbran
Copy link
Contributor

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.

@zaggino
Copy link
Contributor Author

zaggino commented Aug 9, 2013

You're right, it's messed up, I'll fix that in a moment or two.

@zaggino
Copy link
Contributor Author

zaggino commented Aug 9, 2013

.first-page, .prev-page, .next-page, .last-page icons are inline-block positioned so they are ignoring the text-overflow: ellipsis ... don't really know what to do with this without modifying too many things, not that experienced with CSS. Any ideas?

@TomMalbran
Copy link
Contributor

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.

@zaggino
Copy link
Contributor Author

zaggino commented Aug 9, 2013

Tough one - at least for me, but finally got it working.
image

@TomMalbran
Copy link
Contributor

Awesome. The results looks great.

If we split the summary into 3 parts (before, text, after) we could make it look like:
"long test that we want to..." found - Over 500 matches in 100 files (paste pagination here).
Where before = ", text = long test that we want to find in this project and after = found - Over 500 matches in 100 files.

Making only the searched text overflow with ellipsis.

@zaggino
Copy link
Contributor Author

zaggino commented Aug 9, 2013

Great idea. Here it is.
image
I will probably need to fix translations too as one parameter was moved out of the string.

@TomMalbran
Copy link
Contributor

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.

<div class="fixed-col">"</div><div class="contracting-col">{4}</div><div class="fixed-col">found {5} &mdash; {0} {1} in {2} {3}</div>"

@zaggino
Copy link
Contributor Author

zaggino commented Aug 9, 2013

Wasn't sure about putting HTML into strings, ok sure thing.

@TomMalbran
Copy link
Contributor

Yes, is ugly. Maybe we could use 3 strings, instead of harcoding the ".

@TomMalbran
Copy link
Contributor

Actually, add the last " to the current string and have a string for the first ".

@zaggino
Copy link
Contributor Author

zaggino commented Aug 9, 2013

I'm quite lost 😆 like this?

@TomMalbran
Copy link
Contributor

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:

<div class="fixed-col">{{Strings.FIND_IN_FILES_PRE_TITLE}}</div>
<div class="contracting-col">{{query}}</div>
<div class="fixed-col">{{{summary}}}</div>
{{#hasPages}}
...

And the strings would be:

FIND_IN_FILES_PRE_TITLE:  "\"";
FIND_IN_FILES_TITLE: "\" found {4} &mdash; {0} {1} in {2} {3}";

Summary would be the formatted title string.

@zaggino
Copy link
Contributor Author

zaggino commented Aug 9, 2013

No worries @TomMalbran , done.

display: flex;
flex-direction: row;
}
.flex-col(@grow: 0, @shrink: 1, @basis: auto) {
Copy link
Contributor

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

@TomMalbran
Copy link
Contributor

It looks great. I just added a few minor things.

@zaggino
Copy link
Contributor Author

zaggino commented Aug 9, 2013

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) {
Copy link
Contributor

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.

@zaggino
Copy link
Contributor Author

zaggino commented Aug 9, 2013

Sorry I messed that up, should be ok now.

@TomMalbran
Copy link
Contributor

No problem. It looks great now. Will still have to wait for the next sprint to merge it. So some time next week.

@zaggino
Copy link
Contributor Author

zaggino commented Aug 9, 2013

Ok great, let me know if anything will be needed from me.

@zaggino
Copy link
Contributor Author

zaggino commented Aug 16, 2013

@TomMalbran should be ok to merge now ?

@TomMalbran
Copy link
Contributor

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.

@larz0
Copy link
Member

larz0 commented Aug 22, 2013

@zaggino yes, see #998

@TomMalbran
Copy link
Contributor

Lets merge this PR then?

@zaggino
Copy link
Contributor Author

zaggino commented Aug 22, 2013

Sure, or I can merge master and fix also 4870 here if you want, can spare few minutes for that.

@TomMalbran
Copy link
Contributor

If you have time, sure. If not, you can create a new PR for #4870.

@zaggino
Copy link
Contributor Author

zaggino commented Aug 22, 2013

@TomMalbran can you review?

@TomMalbran
Copy link
Contributor

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?

@zaggino
Copy link
Contributor Author

zaggino commented Aug 22, 2013

Sure, moment. I can remove those ID's too.

@TomMalbran
Copy link
Contributor

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.

@zaggino
Copy link
Contributor Author

zaggino commented Aug 22, 2013

Also noticed the replace button, fixed now.

@zaggino
Copy link
Contributor Author

zaggino commented Aug 22, 2013

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,
Copy link
Contributor

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.

Copy link
Contributor

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.

@TomMalbran
Copy link
Contributor

And there is still the issue with long scope labels. In the Brackets source go to src/extensibility/node_modules/unzip/node_modules/fstream/node_modules/mkdirp/test/umask_sunc.js right click on the file and use find in.

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.

@ghost ghost assigned TomMalbran Aug 22, 2013
@zaggino
Copy link
Contributor Author

zaggino commented Aug 22, 2013

@TomMalbran that last mentioned case is now ok. I couldn't make it to preserve spaces so I had to use &nbsp; to actually show them.

"FIND_IN_FILES_TITLE" : "\"{4}\" found {5} &mdash; {0} {1} in {2} {3}",
"FIND_IN_FILES_PRE_TITLE" : "\"",
"FIND_IN_FILES_MID_TITLE" : "\" found",
"FIND_IN_FILES_TITLE" : "&mdash; {0} {1} in {2} {3}",
Copy link
Contributor

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.

@TomMalbran
Copy link
Contributor

Just 2 last minor Nits, and you can rebase before merging :)
Thanks for sticking with this.

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
@zaggino
Copy link
Contributor Author

zaggino commented Aug 22, 2013

Done, why squashed commit shows 17 days ago and not current time? What did I do wrong? :)

@TomMalbran
Copy link
Contributor

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 :)

TomMalbran added a commit that referenced this pull request Aug 22, 2013
@TomMalbran TomMalbran merged commit 8dc29bd into adobe:master Aug 22, 2013
@njx
Copy link
Member

njx commented Aug 22, 2013

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 --ignore-date. (There's also a way to use git commit --amend: see the last ansewr on http://stackoverflow.com/questions/454734/how-can-one-change-the-timestamp-of-an-old-commit-in-git)

That said, if you're just squashing into a single commit, it might be easier to just do a git merge --squash into a new branch. When you merge that way, it doesn't actually create the commit right away (it just sets up everything in your working directory properly so you can do a commit). So, when you create the commit, it will have the right date.

@zaggino zaggino deleted the issue4602 branch August 22, 2013 23:23
@zaggino
Copy link
Contributor Author

zaggino commented Aug 23, 2013

thanks @njx , I'll play with the --ignore-date next time :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants