-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add replace #1552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add replace #1552
Conversation
Thanks for opening this PR! It seems like you added the functionality, but the "Find" Popup looks exactly the same and it's unclear to me how a user would input a replace term. |
Okay, so do you mean, we should add replace term input to Find Popup as well? So instead of having a separate Replace Popup, we can extend the Find Popup to support Replace as well. |
Oh, I didn't realize there was a separate replace popup! Yes, I think it would make sense to combine them as that's pretty typical of find/replace designs. Let me know if you'd like some ideas for how to combine these designs! |
Sure. I would like to work on this further. |
7432578
to
89129a5
Compare
@catarak I have modified the replace dialog this way. May I have your opinion regarding this. And yeah its collapsible. |
@SundeepChand I think that maybe you forgot to commit |
@catarak Actually I've done only the layout part so far. I'm working on adding the functionality now. Once I'm done with that, I will push the code. |
89129a5
to
5b1833a
Compare
@catarak Please check if the find & replace popup works fine. Still there are a couple of bugs in this commit. When replace is done with regex set to true, it exits only after one replacement. There are certain other incomplete things as well, which I'm still trying to figure out. As well as I think instead of having separate Replace & Replace All options in Edit drop-down, we can have a single Replace option. |
163ce47
to
6c08ba0
Compare
@catarak I think its mostly done. Please check this out and let me know if anything is not working. |
Sorry for the late response, as I was a little busy with my university work. Surely, I will update the branch, once I make it better. |
6c08ba0
to
32c4770
Compare
I have fixed the layout of the find popup, but so far I couldn't manage to fix the second issue. I also want to add the replace buttons icons, but couldn't find any. |
32c4770
to
eed8763
Compare
@catarak The layout of the popup is done now. |
@catarak Please check this out. I have fixed all the issues including the text-highlighting in replace mode. Fixing this was a little bit tricky for me, but I'm glad that its done now, and I got to learn more about the codemirror functions. |
This is looking so awesome! I think it's really close. I just added a few minor styling changes. Most significantly, I replaced the "replace" and "replace all" icons with text. Feel free to revert those changes, but for me, I think the "replace" and "replace all" icons are pretty cryptic and I always have to hover over them to figure out which is which. And there's room for the text, so why not put the text? Do you think it would be possible for the replace mode to not switch to the other view? The UX I imagine would be:
Does that make sense? Let me know if you need clarification. |
Yeah I got it. Its going work the way the popup works in codesandbox / VSCode. Will be doing it soon. |
Thanks for taking my feedback and working so hard on this! |
853f1f9
to
014ad59
Compare
@catarak Please check this out & let me know if anything is missing. And yes, please verify the Spanish translations as well. |
Thanks for your changes! I'm not sure how to integrate the Spanish translations because across the rest of the application, they're passed to React components via props, and this is obviously not rendered with React. I wonder if there is a way to render this component with React? Anyway, that's a separate issue (#1588). |
I think it would be better if we deal with that in a separate pull request. But I was talking about the translations which I have written in 'translations/locales/es-419/translations.json' file. |
@oruburos would you mind reviewing the following Spanish translations made as part of this PR: Thank you!! |
Hi @catarak
|
9608633
to
76c9052
Compare
Sorry for the delay merging this in! I'm not super happy with the Find/Replace UX, which is basically the default way the Codemirror find/replace works. I've been doing a little research on how it to fix it though! |
That's totally fine. Please let me know about the issues, if I can help in any way. |
@SundeepChand I added some changes to update the CodeMIrror search to be closest to the latest CodeMirror release, and also to match the UX of VSC. It would be awesome if you could test/review and let me know what you think! |
Hello @catarak! Thanks for working on this. I tested it & yeah the UX feels much nicer now. But I found some bugs in the "Case Insensitive" & "Whole word" buttons. When toggled, they don't show any effect. I've fixed the "Case Insensitive" one by changing some code-mirror defaults. And I need a little time to fix the other one. |
Hi @catarak ! I think its ready to be merged. Please review it. I've changed the |
@SundeepChand thanks for your fixes! Sorry for breaking stuff that you had already worked on. I just pushed some changes to fix the icon colors in each theme. Would you mind testing? |
@catarak Please checkout the changes. I've changed the highlight-color in high-contrast mode as it was barely visible. Feel free to revert that in case if its not ok. I would like to improve the keyboard accessibility of the dialog, but since I'm a little busy for a couple of days, I won't be able to work on this right now. Maybe we can do that in a separate issue. |
Thanks for your updates! I changed the colors a bit more. In order to keep the color contrast with WCAG AAA guidelines, I decided to add an outline for the selected text for the high contrast mode. I think it makes sense to update the keyboard accessibility in another issue! This PR has gotten pretty big so it's probably best to merge it in :) |
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 this is finally ready 🎉
Fixes #1519 & Fixes #1588
I have verified that this pull request:
npm run lint
)Fixes #123
Please review this and tell me if it has something missing. Since I'm no good in Spanish, please make sure that the Spanish translations are accurate.