Repository navigation
Tidy note toolbar and move PDF title into a page footer - #97
Conversation
Move the word count / reading time below the note title and regroup the toolbar actions (clustered icon buttons, no mid-word text wrapping) so the bar stays legible when the notes pane is narrow. Desktop PDF export now renders the note title in a running page footer (title left, page number right) instead of a large title banner, using printToPDF's displayHeaderFooter. buildPdfHtml gains a titleMode param; mobile keeps a compact heading since expo-print can't do running footers.
|
Warning Review limit reached
Next review available in: 7 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (12)
📝 WalkthroughWalkthroughThe note toolbar layout now prevents wrapping and places reading metadata below the title. Desktop PDF exports use running title/page footers, while mobile retains a compact heading. ChangesPDF export footer flow
Note toolbar layout
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant PDFIPC as Electron PDF IPC handler
participant Templates as PDF template builders
participant Chromium as Chromium printToPDF
PDFIPC->>Templates: Build title-free HTML
PDFIPC->>Templates: Build header and footer templates
PDFIPC->>Chromium: Print with custom margins and displayHeaderFooter
Chromium-->>PDFIPC: Return generated PDF
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@shared/notes/pdf-template.ts`:
- Around line 215-222: Update the footer container markup returned by
buildPdfFooterTemplate to use border-box sizing so its 100% width includes the
horizontal 2.2cm padding. Preserve the existing layout, styling, and page-number
alignment.
- Around line 194-203: Centralize an HTML text-context escaping helper in the
PDF template module that escapes ampersands along with angle brackets (and other
required text-context characters). Replace the existing document title escaping
near the document `<title>` and the inline `.pdf-title` escaping in the
`titleMode === "heading"` branch with this shared helper, preserving the current
title rendering behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: dbf9fa8d-6372-470c-93ea-918988004879
📒 Files selected for processing (6)
changelogs/v2.5.9.mdelectron/ipc/pdf-export.tselectron/lib/pdf-template.tsshared/notes/pdf-template.test.tsshared/notes/pdf-template.tssrc/components/notes/note-editor.tsx
Add a 'Merge into…' action to each project's sidebar menu that moves all notes, tasks, board columns, and Idea Flow nodes into a chosen destination project, then deletes the emptied source. - q.mergeProject: one transaction repointing notes/cards/columns/idea-flow plus the FK-less chat_threads/tool_attachments/pi_agent_sessions that a bare project delete would orphan. Cards map into the destination's same-type column; custom columns are recreated. Uses direct SET for project_id so the move actually persists (updateCard/updateNote COALESCE lists omit it). - db:project:merge IPC handler relocates each moved note's .md into the target folder, removes the source folder, and reconciles as a self-heal. - project.merge preload binding + mergeProject store action (re-hydrates). - Merge dialog uses the standard DropdownMenu picker (not a native select). - Unit tests + changelog + What's New entry.
- Centralize an escapeHtmlText() helper (escapes & first, then < and >) and use it for the document <title>, the in-body heading, and the footer title, so text-context escaping is consistent — the title/heading previously escaped only < and dropped &. - Add box-sizing:border-box to the footer container so its 100% width includes the 2.2cm horizontal padding; Chromium's footer template is an isolated document that doesn't inherit the global border-box rule, so without it the padded footer overflowed the page box and could clip the page number.
Dragging a card to another project routed through card.update, whose SQL COALESCE list has no project_id/workspace_id columns — so the move updated column_id but left project_id/workspace_id on the old project. The row was then inconsistent (column in project B, project_id in project A) and re-surfaced in the source project on the next board refresh or sync reconcile, exactly like the note-move bug that already has a dedicated query. - Add q.moveCardToProject (direct SET of project_id + workspace_id + column_id + order; resolves the workspace from the target project and validates the target column belongs to it). - Add db:card:moveToProject IPC handler (+ relationship/semantic recompute for the new workspace) and card.moveToProject preload binding. - Route the store's moveCardToProject and its undo/redo command through the new channel; thread prevWorkspaceId so undo restores the original workspace too. - Unit tests + changelog.
What does this PR do?
Tidies the note-view toolbar and reworks PDF export. The word count / reading time moves below the note title, the toolbar actions are regrouped so they stay legible when the notes pane is narrow, and desktop PDF exports now show the note title in a running page footer (title left, page number right) instead of a large title banner.
Type of change
Screenshots / recording
page / total(right).Checklist
npm run type-check:allpassesnpm run lintpassesnpm testpasses (runsnpm run compilefirst soelectron/bundle-guard.test.tsactually executes —npm run test:bundleto run just that)npm run test:e2epasses (run before merging UI changes or cutting a release)changelogs/v2.5.9.mdvar(--accent),var(--text-primary), etc.)text-[Npx]pixel font classes — rem equivalents only (text-[0.714rem],text-xs, etc.)handle()and returnIpcResult<T>— N/A (no new handlers; existingapp:exportNotePdfunchanged in shape)schema.ts— N/Aelectron/db/queries.ts— N/AdependenciesordevDependencies— N/A--external:<pkg>flag change — N/ANotes for reviewer
printToPDF'sdisplayHeaderFooterfor the footer (title + page numbers) — CSS@pagecounters aren't reliable underprintToPDF, hence the native footer template. Margins switched fromdefaultto explicitcustomvalues to leave room for the footer.buildPdfHtmlgains atitleModeparam ("heading" | "none", default"heading"). Desktop passes"none"; mobile keeps"heading"because expo-print can't render Chromium running footers.whitespace-nowrap; icon buttons wrapped in a single flex cluster.Summary by CodeRabbit
New Features
UI Improvements
Bug Fixes