JS-9778: Refactor Search & Replace popup layout and styling#2224
JS-9778: Refactor Search & Replace popup layout and styling#2224barissalihbabacan wants to merge 6 commits into
Conversation
|
Please verify your changes and include only changes that your PR introduces, you include changes that are irrelevant to the PR. |
4bbbf04 to
55f6c94
Compare
Changes summaryAddressing feedback from @ra3orblade and @yasyuk. Bug fix: Replace (single) button not working (@yasyuk)Root cause: The Fix ( const containerEl = U.Dom.hasClass(focusable, 'editable')
? focusable
: U.Dom.select('.editable', focusable);Styling (@yasyuk)
Irrelevant changes cleaned up (@ra3orblade)Rebased onto the latest
|
|
@barissalihbabacan please check your changes, there are changes to the text.json which are removing strings that are used in the code. |
|
Hi @ra3orblade, I've restored the missing translation keys in The changes have been pushed to the branch. Let me know if everything looks good now! |
- Fix Replace (single) button: .editable and .focusable are the same element in the Anytype Editable component; querying .editable inside .focusable always returned null, making position null and silently aborting the replace operation - Use --color-shape-tertiary background for filterContainer, arrowWrapper and replaceWrapper (replaces color-shape-highlight-medium / bg-primary) - Remove 1px borders from filterContainer, arrowWrapper and replaceWrapper per reviewer feedback - Switch pre-commit hook from npx to bunx to fix npm min-release-age incompatibility with npm 11.12.0 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
8fe8816 to
02500ca
Compare
thanks, from my side looks good, if @yasyuk does not have any design changes I will merge. |
|
Thanks! The general implementation looks good from my side. I'll tweak the icons myself in the develop branch. However, there are a few bugs left in the general functionality:
|
|
@yasyuk @ra3orblade Thank you both for your time and the detailed feedback! It is currently the Kurban Bayramı (Eid al-Adha) holiday, so I am briefly away from the keyboard, but I will dive into these remaining bugs and get them resolved very soon. Thanks for your patience! |
…ace replacements - Verify cached position against store text before replacing to prevent wrong-offset replacements when DOM is stale - Add MutationObserver to detect undo/redo/external edits and re-run search so match counter stays in sync - Replace unreliable setTimeout(50) with requestAnimationFrame chaining for post-replace DOM synchronization - Add observer lifecycle management (disconnect during own DOM mutations, reconnect after, cleanup on unmount)
|
Sorry for the late response — I've been in the middle of a product launch at work for the past 3 weeks. Bug fixes for the 3 issues reported by @yasyuk: Root cause: Block text components are not wrapped in MobX Fixes:
|

Description
This PR refactors the Search & Replace popup component layout and styling to align with the updated design specifications and resolve visual bugs:
Layout & Alignment Updates:
menu/action/replaceicon (using the requested Replace icon:arrowWrapperto toggle Replace mode. The icon changes color to--color-control-accent(blue) when Replace mode is active.--color-control-inactive..replaceWrapperblock: it is now placed as a direct child of.wrapso its width spans the entire width of the popup (aligning its right edge with the arrows pill).Matte/Opaque Background:
.replaceWrapperfrom semi-transparentvar(--color-shape-highlight-medium)to solidvar(--color-bg-primary)to prevent editor content/text from bleeding through and rendering behind it.Internal Structure & UX:
.replaceWrapperinterior layout: the "Replace with..." input field is placed at the top, and the buttons ("Replace all" as a text link, and "Replace" as a blue pill button) are aligned at the bottom-right.useEffecthook to automatically recalculate the menu's position viaposition()wheneverreplaceModetoggles, preventing any alignment/popover shifting issues.isReadonlyflag directly fromkeyboard.ts(evaluating space participant permissions, locked status, and deleted/archived states).What type of PR is this? (check all applicable)
Related Tickets & Documents
Mobile & Desktop Screenshots/Recordings
Added tests?
Added to documentation?
[optional] Are there any post-deployment tasks we need to perform?