Skip to content

feat: add Page Numbers tool#49

Merged
viralcodex merged 4 commits into
mainfrom
page-numbers-feature
Jul 7, 2026
Merged

feat: add Page Numbers tool#49
viralcodex merged 4 commits into
mainfrom
page-numbers-feature

Conversation

@viralcodex

@viralcodex viralcodex commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds a Page Numbers tool: users choose position (six presets), start number, font (from pdf-lib StandardFonts), and font size, then stamp numbers onto every page of the selected PDF.
  • Writes a `-numbered` sibling file and opens it on success.
  • Wires new types into the model layer, registers the tool in the tools registry, adds the main-ui route, and adds the menu entry.

Depends on #48 (Dropdown/TextInput) and #45 (KeyboardNavProvider).

Test plan

  • `bun run typecheck`
  • `bun test` (107/107 pass)
  • Manual: pick a PDF, cycle through positions/fonts, apply, verify page numbers appear at the chosen corner with the chosen font/size.
  • Manual: set start number to something >1 and confirm the first stamped number matches.

…ovider

Splits useKeyboardNav into createKeyboardNav (constructor) and useKeyboardNav
(context consumer) so descendant panels can share one focus ring instead of
each panel spinning up its own. main-ui wraps its tool + preview subtree in the
new provider. Adds a persistent field to FocusableElement so consumers can
keep long-lived focusable elements registered across effect reruns
(clearElements now only drops non-persistent entries).

Callers outside the provider fall through to a fresh instance, preserving
current behavior for standalone components.
Introduces a Dropdown primitive that owns option list rendering,
open/close, hover/focus highlighting, and keyboard navigation
(up/down/j/k, return to select, escape/tab to close). The
scrollable option list uses contentOptions for flexDirection so
the internal viewport lays out correctly and the scrollbar sits
alongside the items.

Generalizes TextInput's value/onInput over T so callers can pass
strings or numeric values without casting, adds spacing knobs the
new page-numbers UI needs, and drops the extra label padding that
made stacked inputs look uneven.
Adds a new tool that stamps page numbers onto a PDF. Users can
pick position (six corner/center presets), start number, font
(from pdf-lib StandardFonts), and font size. The tool writes a
"-numbered" sibling file and opens it on success.

Wires the tool through the model layer, tool registry, main-ui
route, and the tool menu.
@viralcodex viralcodex merged commit 4128a8e into main Jul 7, 2026
1 check passed
@viralcodex viralcodex deleted the page-numbers-feature branch July 7, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant