feat(toolbar): flat toolbar redesign + agent presence indicator#790
feat(toolbar): flat toolbar redesign + agent presence indicator#790jacobjove wants to merge 9 commits into
Conversation
|
Someone is attempting to deploy a commit to the EigenPal Team on Vercel. A member of the Team first needs to authorize it. |
|
All contributors have signed the CLA ✍️ ✅ Posted by the CLA bot. |
a6571c2 to
20d89c5
Compare
Refresh the editor toolbar to a flat, single-surface design — borderless icon buttons, a blue-tint active state, a segmented font-size control, and consistent dividers/spacing — and add an AgentActivityIndicator component for AI-collaborator presence in the title-bar slot. React + Vue. Also reproduce the button-relevant subset of Tailwind preflight, scoped to .ep-root. The library ships without preflight (so it never resets a host app's styles); without it, host apps lacking their own reset get leftover user-agent button chrome, width-only border utilities that render nothing, no pointer cursor on buttons, and content-box inputs that resize on focus. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
20d89c5 to
0414e17
Compare
- Replace bare hex/rgba/named colors in the toolbar + agent-presence components with the existing --doc-* chrome tokens (surface, shadow, primary, text, border, bg-hover, text-subtle/-muted) so they re-theme under .ep-root.dark. Adds a constant --doc-on-agent token for the white foreground on the indigo agent badge (badge stays indigo in dark, so it must not invert). React + Vue. - Regenerate docs/api/docx-editor-react/ui.api.md for the ZoomControl props this PR added — api:check was missing them (would fail CI on merge).
… reset The library ships `@tailwind utilities` only (no preflight) so it never resets a host app's styles. Document the silent breakages in a host without its own reset (UA button chrome, no-op width-only borders, content-box inputs, var-dependent transform utilities) and the .ep-root scoped subset that mitigates them. Pairs with the editor.css preflight reset in eigenpal#790. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The api-extractor golden for @eigenpal/docx-editor-react drifted once main's toolchain bump changed how the AgentActivityIndicator return type resolves (react_jsx_runtime.JSX.Element -> React_2.JSX.Element). Regenerated on the merged state so api:check is green.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR delivers a flat toolbar redesign (white surface, top hairline divider, blue-tint active state, segmented font-size control) across React and Vue, fixes latent preflight-related rendering bugs in host apps without a CSS reset, and adds
Confidence Score: 3/5Not safe to merge without addressing the Vue Toolbar regressions and the unconnected agent presence dot. The toolbar redesign and AgentActivityIndicator additions are solid, but the Vue adapter ships with three user-visible regressions: document-specific styles vanish from the style picker, font size can no longer be typed directly, and dropdown triggers lose their accessibility semantics. The new AgentPanelToggle presence dot is also impossible to activate through DocxEditorToolbar because the activity prop is never threaded through, and ZoomControl exposes five props that are silently ignored. packages/vue/src/components/Toolbar.vue (three regressions), packages/react/src/components/DocxEditor/DocxEditorToolbar.tsx (activity not forwarded), packages/react/src/components/ui/ZoomControl.tsx (dead props) Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
subgraph React
DET[DocxEditorToolbar] -->|active, badge, onClick| APT[AgentPanelToggle]
APT -. activity prop exists but NOT forwarded .-> dot[presence dot - unreachable]
DET --> TB[Toolbar]
TB --> TG[ToolbarGroup with leading divider]
TG --> FSP[FontSizePicker - editable input kept]
TG --> ZC[ZoomControl - Select only]
ZC -. minZoom maxZoom showButtons silently ignored .-> ZC
end
subgraph Vue
VTB[Toolbar.vue] --> VFG[font-size - button only no typing]
VTB --> VSP[style picker - static presets only]
VTB --> VAAT[AgentActivityIndicator.vue]
end
subgraph Shared
CSS[editor.css - scoped preflight + ep-agent-pulse]
TW[tailwind-preset.cjs - doc-separator + doc-agent tokens]
AAI[AgentActivityIndicator.tsx - activity prop drives chip]
end
CSS --> React
CSS --> Vue
TW --> React
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
subgraph React
DET[DocxEditorToolbar] -->|active, badge, onClick| APT[AgentPanelToggle]
APT -. activity prop exists but NOT forwarded .-> dot[presence dot - unreachable]
DET --> TB[Toolbar]
TB --> TG[ToolbarGroup with leading divider]
TG --> FSP[FontSizePicker - editable input kept]
TG --> ZC[ZoomControl - Select only]
ZC -. minZoom maxZoom showButtons silently ignored .-> ZC
end
subgraph Vue
VTB[Toolbar.vue] --> VFG[font-size - button only no typing]
VTB --> VSP[style picker - static presets only]
VTB --> VAAT[AgentActivityIndicator.vue]
end
subgraph Shared
CSS[editor.css - scoped preflight + ep-agent-pulse]
TW[tailwind-preset.cjs - doc-separator + doc-agent tokens]
AAI[AgentActivityIndicator.tsx - activity prop drives chip]
end
CSS --> React
CSS --> Vue
TW --> React
Reviews (1): Last reviewed commit: "Merge branch 'main' into feat/toolbar-re..." | Re-trigger Greptile |
# Conflicts: # packages/core/src/styles/editor.css # packages/react/src/components/Toolbar.tsx
Resolves the Greptile review on eigenpal#790 plus the merge conflict with main. React: - ZoomControl: remove 5 dead props (minZoom, maxZoom, showButtons, persistZoom, storageKey) that were declared but never consumed; drop the no-op values the Toolbar caller passed. Document `levels` as the single source of range (smallest/largest preset = bounds). - DocxEditorToolbar: forward agentPanel.activity to AgentPanelToggle so the awareness dot is reachable from the public <DocxEditor agentPanel> surface; add `activity` to AgentPanelOptions. - Select: SelectLabel uses text-doc-text-subtle (doc token) instead of hardcoded text-slate-500 so it survives dark mode. Vue (parity regressions vs main, restored): - Restore documentStyles prop + useParagraphStyleOptions so real document styles show in the style picker (not just static presets). - Restore the editable font-size <input> (direct text entry of arbitrary sizes) via useToolbarFontSize, replacing the display-only button. - Restore aria-expanded / aria-haspopup on the zoom, style, font, size, align, and spacing dropdown triggers. Merge: resolve conflicts in editor.css (keep both agent + scrollbar tokens; re-point light-theme --doc-toggle-active-* to the flat blue-tint so the redesign's active state lands through main's .ep-toolbar-toggle mechanism) and Toolbar.tsx (adopt main's CSS-class toggle states). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Review follow-up on eigenpal#790. The restored size box is a persistent <input> with a one-way :value bind. On blur/Enter with empty or non-numeric input, commitFontSize applies nothing, so currentFontSize never changes and Vue's VDOM diff never re-patches the input — the typed garbage (e.g. "abc") lingers in the box while the document keeps its real size. Reset the DOM value to currentFontSize when nothing was applied; skip the reset on a valid commit so reactivity re-patches without a flash of the old value. Adds composable unit tests (commit half-points, clamp, snap-back, sizeTyped guard, preset pick). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Refreshes the editor toolbar to a flat, single-surface design (borderless icon buttons, blue-tint active state, segmented font-size control, consistent dividers) and adds an
AgentActivityIndicatorcomponent for showing AI-collaborator presence in the title-bar slot.Separately fixes a latent rendering bug: the library ships without Tailwind's preflight (by design, so it never resets a host app's styles), but nothing reproduced the button-relevant subset for the editor's own controls. In host apps without their own reset, toolbar buttons inherited user-agent chrome, width-only border utilities rendered nothing (
border-styledefaults tonone), buttons had no pointer cursor, and content-box inputs resized on focus. Now reproduced scoped to.ep-root.React and Vue both updated; changeset included (minor — additive
AgentActivityIndicator).Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.