Add header/footer toolbar with page number button#111
Conversation
Show a simplified toolbar when editing header/footer regions instead of the full body toolbar. The header/footer toolbar includes basic formatting (bold, italic, underline, colors, alignment) and a dedicated "Page number" insert button. An onEditContextChange callback on EditorAPI drives the toolbar switch reactively. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Verification: verify:selfResult: ✅ PASS in 113.8s
Verification: verify:integrationResult: ✅ PASS |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR introduces an edit context tracking system for the document editor. When users switch between editing body, header, or footer sections, a callback mechanism notifies the frontend React component to update state and conditionally render a specialized toolbar UI for headers and footers. Changes
Sequence DiagramsequenceDiagram
participant User
participant TextEditor
participant EditorAPI
participant DocsLayout as React Component
participant Toolbar
User->>TextEditor: Click in header/footer section
TextEditor->>TextEditor: setEditContext('header'|'footer'|'body')
alt Context changed
TextEditor->>TextEditor: Invoke editContextChangeCallback
end
TextEditor->>EditorAPI: Callback notification via delegation
EditorAPI->>DocsLayout: onEditContextChange callback fires
DocsLayout->>DocsLayout: setEditContext(newContext)
DocsLayout->>Toolbar: Re-render with editContext prop
Toolbar->>Toolbar: Conditional render: show header/footer UI or body UI
Toolbar->>User: Display context-appropriate toolbar
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
#icononEditContextChangecallback to EditorAPI for reactive toolbar switchingTest plan
#placeholder inserted, renders as page number🤖 Generated with Claude Code
Summary by CodeRabbit