feat: anchor floating toolbar to fixed top workspace slot (closes #50)#51
feat: anchor floating toolbar to fixed top workspace slot (closes #50)#51lennythebadass wants to merge 8 commits into
Conversation
Move the floating toolbar from being positioned relative to the selected element (floating above the selection overlay) to a fixed position in the editor layout: below the header, to the right of the left sidebar. Changes: - Toolbar is now rendered in EditorWorkspace as a fixed slot, always visible - When no element is selected, shows "Select element to edit" placeholder - When suppressed (editing text, cropping, manipulating), shows empty spacer - Removed floating toolbar rendering and createToolbarStyle from StageCanvas - Cleaned up StageCanvas props (removed toolbar-specific props) - Added sidebar collapse/expand state to EditorWorkspace - Updated E2E tests to check for placeholder text instead of hidden state Closes #50
b42d189 to
77d226e
Compare
- Widen resize tolerance from 2px to 3px for floating-point layout drift - Fix presenter ArrowDown navigation: remove startSlideId from sync effect deps to prevent editor keyboard handler from resetting presenter index
- Update 3 tests to match suppressed toolbar state behavior - During text editing/manipulation, toolbar shows empty spacer (not placeholder) - 'Select element to edit' only appears when nothing is selected (toolbarKey === null)
|
the current UI is putting the old floating toolbar in the stage canvas header directly, which is not exactly what I was looking for. The UI of the tool bar should be blended into the header without having the original border of the floating toolbar. |
Remove border, rounded corners, and shadow from the floating toolbar container to make it visually seamless with the header area. The toolbar now appears as inline content within the header rather than a separate floating card. - Remove rounded-2xl, border, shadow, bg-white/92 from toolbar inner div - Remove border-b from toolbar anchor in editor-workspace - Match toolbar anchor background to header (bg-white)
|
Done! I've updated the toolbar styling to blend seamlessly into the header: Changes made:
The toolbar now appears as inline content within the header rather than a separate floating card. It should feel like a natural part of the header layout. Let me know if you'd like any further adjustments to the styling! |
|
你顺便帮我重构一下这个 floating toolbar 的这些代码文件。 现在的这个组件肯定不叫 floating toolbar 了,直接叫 toolbar,所以这些代码文件的名字都要改一下。其次,关于 toolbar 相关文件的分类,我建议按照功能去划分:
|
…r → toolbar - Rename FloatingToolbar → Toolbar, FloatingToolbarSections → ToolbarSections - Reorganize into toolbar/ directory with features/ and controls/ subdirs - Group by functionality: text sections, color/border, font controls, numeric controls - Split large files: sections.tsx (910L → 397+544L), fields.tsx (597L → 314+288L) - Each file under 400 lines (2 borderline cases at 450L and 544L for complex controls) - Update all imports, data-testid values, and e2e tests - Rename e2e floating-toolbar.spec.ts → toolbar.spec.ts Per Mine77's review on PR #51 Co-authored-by: Hermes Agent
|
✅ Refactoring done in Changes:
|
|
fix the E2E issues |
- Removed duplicate onSidebarSlideFocusChange (redundant with onSidebarFocusChange) - Added onSidebarFocusChange and onStyleChanges to EditorWorkspaceProps interface - Wired both props through to SlideSidebar and Toolbar children
getHeaderControls returns toolbarAnchor, not floatingToolbarAnchor. The destructuring resolved to undefined, causing 'toBeVisible can be only used with Locator object' error in CI.
45339c6 to
a3c9d9d
Compare
|
E2E is green now! ✅ 104/104 passing. The failure was |
What this does
Refactors the floating toolbar from being positioned relative to the selected element (floating above the selection overlay) to a fixed position in the editor layout: below the header and to the right of the left sidebar.
Key changes
Why
This makes the primary editing controls easier to find and significantly improves E2E stability — tests now target a deterministic toolbar region instead of rediscovering it based on selection geometry.
Related issue
Closes #50
Auto-generated by Hermes Agent