Repository navigation
refactor(editor): the ToolRail renders from a table of tools - #253
Merged
Merged
Conversation
PR 0c of docs/feature-modules-plan.md. The rail rendered seven hard-coded buttons; now it maps over EDITOR_TOOLS in src/components/editor/ editorTools.js, one row per tool in the same order: key, icon, label key, the capability flag it needs, and what the rail does without it — "hidden" (LUT) or "locked" (sticker, AI repaint). The icon components move with the table. No behaviour change: same icons, titles, data-testids (still derived from the translated label), active styling and locked buttons. The capability names stay string literals, so src/api/capabilities.test.js finds them at the new location. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR 0c of
docs/feature-modules-plan.md§4 (the plan itself is in PR #252). Zero behaviour change: the editor's tool rail stops hard-coding its seven buttons so feature modules can contribute tools later.What changes
src/components/editor/editorTools.jsexportingEDITOR_TOOLS, one row per tool in today's order:{ key, icon, labelKey, cap, unavailable }.capis the capability flag the tool needs ("lut","stickerExtract","aiRepaint", ornull);unavailablesays what the rail does without it —"hidden"(LUT disappears, as today) or"locked"(sticker and AI repaint stay, greyed, with the platform hint in their title, as today). ThePhotoFrameandLutGlyphicon components move here with the table (createElementrather than JSX, since the file is.js).ToolRail.jsxmaps over the table. Same icons, sameoverlay.tools.*labels, sametitletooltips, same active/hover styling;data-testidis still derived from the translated label (tool-crop,tool-lut, …), and locked buttons still carry no test id.EditorOverlay.jsx,editorStateModel.jsand the panels are untouched.Capability test
src/api/capabilities.test.jsscanssrc/**as text forcap: "…"literals, so it finds the three flags at the new location without changes. (A comment in the new file that spelledcap: "name"tripped the scan on the first run and is reworded.)Verified
npm run check: lint, 430 unit tests, build — green.03-editor,04-sticker,07-depth,33-split,40-crop-mouse,41-text-layer-panel,67-lut,80-repaint-reference: 52 passed, 1 skipped (67's "no LUT tool off macOS" case, which skips on a Mac by design — CI's Windows job covers the hidden path).🤖 Generated with Claude Code