Skip to content

Fix font changes inside lists; silence dead-code warnings - #46

Merged
setzor merged 1 commit into
mainfrom
vibe/font-list-fix-f21749
Oct 24, 2026
Merged

setzor merged 1 commit into
mainfrom
vibe/font-list-fix-f21749

Conversation

@setzor

@setzor setzor commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Font change in lists bug: selecting text inside a numbered/bulleted list and picking a font from the toolbar did nothing. Root cause: tiptap's removeEmptyTextStyle (from @tiptap/extension-text-style) walks all nodes in the selection and calls tr.removeMark over the full nodeSize of non-textblock ancestors — inside a list, the ol/li containers match its "no marks" condition, so it stripped the freshly applied textStyle mark from the text within. Outside lists the ancestors are textblocks, which it skips, so the bug only appeared in lists.
  • Replaced it with a text-node-only cleanup (removeEmptyTextStyleTextOnly command in src/typography.ts) used by setFontFamily/unsetFontFamily/setFontSizePx/unsetFontSizePx. Behavior is unchanged everywhere else.
  • Rust warnings: is_entry_filename and is_legacy_entry_filename in src-tauri/src/entry.rs are public helpers currently exercised only by tests, producing dead_code warnings on every cargo run. Annotated them with #[cfg_attr(not(test), allow(dead_code))] instead of deleting, since they document the filename format contract.
  • Added src/typography.test.ts covering font family/size set, unset, double-change, and save/load round-trip inside ordered lists.

Verification

  • pnpm test — 77 tests pass (5 new typography tests)
  • pnpm build (tsc + vite) passes
  • entry.rs verified warning-free via a standalone cargo check/cargo test (the full Tauri build needs GTK system libs not present in this sandbox; CI will confirm)

Co-authored-by: setzor <setzor@users.noreply.github.com>
@setzor
setzor marked this pull request as ready for review October 24, 2026 10:04
@setzor
setzor merged commit 688b11d into main Oct 24, 2026
2 checks passed
@setzor
setzor deleted the vibe/font-list-fix-f21749 branch October 24, 2026 10: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.

2 participants