Repository navigation
Conversation
Three small editor issues found while testing fonts (2026-11-10)None looks caused by the font work, and we are not fixing them in the font PR. Issues 1 and 3 were reproduced with plain bold. Issue 2 was seen after a size change; I did not check it with bold. 1. Source gets blocked (Markdown)Steps: type text in Source, go back to Rich, change that same text, go back to Source. Result: "Source editing is paused to protect changes made in Rich." Returning to Rich does not help. Only reloading the page unblocks it. No text is lost. Cause: Source keeps its own undo history, and Rich changed the same text, so Scient can no longer keep that history consistent. It blocks Source rather than risk damaging the text ( Option A: keep as is. Question: was the block deliberate? 2. Rich Undo resets after a Source round trip (Markdown)Steps: Rich, then Source, then Rich again. The Undo button is greyed out: the history starts from zero. Question: is this intended? 3. Undo button always greyed (LaTeX Visual)Cmd+Z and Cmd+Shift+Z work. The toolbar Undo button stays greyed out, even after bold. Question: should the button follow the history? |
Trust the author of #828 (editor Font/Size menu) in the vouch workflow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thank you, Tova, this is careful work, and the PR description and the issue notes made it easy to review. The approach is right: it builds on the shared Text menu and on the size and family marks the LaTeX editor already had. The Markdown source ledger is a good fit for keeping untouched source exactly as it was. We checked head Here is what needs fixing before merge. Each item comes with an example to reproduce it. Needs fixing1. Word export of LaTeX: some size groups break the export or lose their size
Suggestion: keep the group's own braces around the carrier ( 2. Word export: the size rewrite reaches into inline verbatim 3. Document settings can change front-matter lines the user didn't touch
Please update only the font key the user changed, keeping the other key's original value and comments. If a font value spans several lines and can't be rewritten safely, leave the block untouched and make that setting unavailable. 4. New front matter in a file whose first line is blank Please write newly created front matter before the ledger prefix, keeping the original blank lines below it. 5. LaTeX Visual: a size on a selection that crosses math or bold loses a space Please keep a leading space when serialising each size-marked text node: both 6. LaTeX Font: Default removes 7. Word sizes for LaTeX documents at 11pt and 12pt Please share the standard-class size table the Visual editor uses ( 8. Nested font spans of the same kind show the wrong font <span style="font-family:serif">A <span style="font-family:monospace">B</span> C</span>Rich shows " C" in the default font instead of serif, because opening the inner mark replaces the outer one and closing it removes both. In our tries, the saved source stayed safe: typing kept the original wrappers, and formatting changes were blocked by the source-fidelity guard. But the view is wrong. Please either restore the outer font when the inner span closes, or treat same-kind nested spans as source in both the ledger ( 9. Docs Smaller points (fine as follow-ups)
Your three questions
Thanks again. Once the required fixes are in, we'll recheck them in the app before deciding whether it's ready to merge. |
|
One more item for the list, on the front-matter key for the document size: 10. Please use Since the key hasn't shipped yet, please switch to |
- Shared Text > Font / Size menu: three generic families, ten sizes. - Markdown: recognised <span style="font-size|font-family"> marks on a selection; front matter keys and a Document settings card for the whole document. - LaTeX Visual: menu wired to the existing size and family marks; a Font field in Document settings (\familydefault). - PDF export keeps the recognised span styles before sanitising. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- Recognised Markdown <span style> forms become Word character styles
(one per size, family, and size with family) before raw HTML is
stripped; any other HTML is still dropped.
- The font-size and font-family front matter keys set the base font of
the reference document; local sizes scale from that base.
- LaTeX: {\large ...} groups are rewritten to a form Pandoc keeps and
mapped to the same styles; \textsf and \textrm are kept; the class
option and \familydefault set the base font.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ut of command arguments
Found by an independent review. Pasted <span data-scient-font-*> values are now checked
against the known size and family names. The Word export no longer rewrites a size
command that is a command argument (\textbf{\large x}), nor verbatim or bracket math.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ont matter, share the document sizes A local size inside a heading or a footnote is now a share of that text's size in the Word export, as in the editor. Writing the document font no longer drops blank lines of the front matter. The 10/11/12 pt sizes and the leading front matter pattern are defined once. Added guards for tags inside code or links within a font span. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…d test heading and footnote sizes with Pandoc Found by a second independent review. A heading or a footnote now starts from its own size and no outer font; the reference document cache key no longer depends on span order. Added integration tests for sizes inside a heading and a footnote, and stricter unit tests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sizes are free numbers of points (1 to 100) in both editors and in the Word
export; fonts come from one shared catalogue. Markdown stores
`font-size:12pt` and `font-family:'Times New Roman'`; LaTeX Visual stores
`{\fontsize{N}{M}\selectfont ...}` groups. Both editors share one FontControls
panel. The Word export defines one character style per used size and font.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…, Word export of font groups Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ink look and verbatim in the Word export; docs Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…xports; test spaces around math Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… hidden closing tags stay source, fontspec package, document font card state Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ut presets Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…the selection toolbar Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ctions Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… familydefault Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… is open The toolbar followed the selection, so it moved a little at every size step and the buttons shifted under the pointer. Its position is now fixed while the size panel is open and measured again when it closes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A space or line break where the set of styles changes carries no style, in the writer (a space between two styled words no longer takes the open styles) and in the round-trip guard, which also ignores spaces at paragraph ends and next to line breaks. This applies to bold, italic, strike, size and family, and removes most "would read back differently" refusals: typing a space after a styled word, removing bold from the last word of a phrase, changing a size next to a line break, sizing two bold words, edge spaces inside a tag. Size and font commands skip inline code, which the reader cannot read back with a span around it. The size and font shown for a selection ignore text made only of spaces, so words sized one by one show their size. Tests: directed cases, and a seeded gesture battery over 16 paragraph kinds where only a known family (a delimiter touching a size tag inside a word) may still be refused. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…-browser font gesture tests The rule that edge whitespace carries no style also stripped the link mark from a space between a link's plain and bold parts, splitting one link into three. Only the marks the file cannot put around a space (em, strong, strike, size, family) are removed now. fontGestures.browser.test.ts replays typing, Enter, bold and size gestures with real keystrokes and checks no edit is refused. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…phasis Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…onger gesture tests An independent review found, and a run confirmed: - turning inline code on over sized text was refused; it now drops the size and family; - a combining accent ended up outside the sized word; - the size shown for a selection counted inline code and read as mixed; - the seeded gesture battery used a generator that produced almost only one command, so most gestures never ran; it now uses a spread generator, and its known-refusal list covers emphasis delimiters between a letter and punctuation (same refusal before this branch); - two tests compared a text with its own reopening and checked nothing; they assert the text. New tests cover links across bold, Hebrew, non-breaking space and inline code. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…eleting a line's first word An audit ran the new tests against the code before the whitespace rule: 29 of 74 failed there, but only 1 of the 9 browser tests did. Four browser tests now select with Shift+Arrow and type with real keys under the conditions that failed before (a space beside a sized word, italic over two sizes, bold removed from the last word, a size after a sized line break); they fail on the old code. They wait for the editor to read the browser selection, which made one of them flaky under load. A unit test records that deleting the first word of a line after a line break is accepted, as at the start of a paragraph; refusing it would block a common gesture. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… under the caret A size applied at a caret in "don't" or "l'arbre" covered only the part before the apostrophe. A lone apostrophe still ends the word. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
8e5b198 to
b5eef10
Compare
|
The branch is rebuilt on current Design
Whitespace and the round-trip guard
Your items
Smaller points: commented class and family lines are no longer read by the Word export; a size inside a link keeps the link's blue underline (character style "14 pt link"); a size on a table cell selection reaches every selected cell (test). My three questions of 2026-11-10 (Source paused, Rich Undo reset, LaTeX Undo button greyed): your answers are noted. This PR changes none of them; each stays a separate fix on Open question for you
Checked (2026-11-16, on the rebased branch)
Known limits
Not verified
|
|
This PR changes the test suite by +145 test cases (browser +25, unit +83, server +37). New browser test files: Keep tests that would fail for a real reason, and test logic below the UI where it can be. See Testing. |
…r starts fast The LaTeX Visual worker imported the whole Markdown package (parsers included) through latexTextFormatting.ts, and the LaTeX browser tests timed out waiting for it. A ./fonts entry exports only the font catalogue and span forms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the Word export The base font now follows what the Document settings card writes: a catalogue font code in \familydefault (pdfLaTeX) or a catalogue font in \setmainfont (XeLaTeX, LuaLaTeX). A document without a class size option is 10 pt, as in LaTeX. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h editors LaTeX Visual counted the spaces between words sized one by one, so it showed no size, and its caret word stopped at apostrophes and combining accents. Both editors now use writing/fontTarget.ts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… its difference As in Word, each run of a selection moves by one point and the size field stays empty; text without a size starts from the size it is drawn at, so a heading word grows from the heading's size. The panel no longer needs the document's body size. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A bold, italic or strike delimiter touching a span tag inside a word was misread by CommonMark, so the edit was refused. With size and font first in mark rank, the gesture battery's refusals go from 111 to 91 per 36,500 gestures (the 20 tag cases are gone; the rest are formulas and an unrelated nested-list deletion). The battery no longer allows that family. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rtcuts A click in the size field lists Word's sizes (8 to 72) under it, like the font list; choosing one applies it and closes the panel. Mod+> and Mod+< (Cmd+Shift+. and Cmd+Shift+, on a US keyboard) step the size in both editors, with the same per-word rule as the minus and plus buttons. No existing app, editor or menu shortcut uses these keys. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… Pandoc Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, links whole Rank alone did not decide nesting: the serializer reorders mixable marks to fit those already open, so a size inside a bold part of a word was written inside the delimiters and refused. Font marks are no longer mixable. Links rank first, so a partly sized link stays one link with the span inside it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…own size The buttons stepped every run per word only on a mixed selection; over a heading and a paragraph without explicit sizes they set one measured size. They now always go through the per-run rule, shared by both editors (steppedRuns in fontTarget.ts), with Alt for 0.5 pt and Shift for 10 pt; the field no longer re-commits its unchanged value after a step. The drawn size is read inside the run, so it no longer depends on where the selection starts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…text A catalogue font in \setmainfont (options allowed) now wins over a font code in \familydefault and over \rmdefault; a sans-serif or monospace \familydefault still wins over both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…icked Stepping the size in Markdown gave focus back to the editor, so the selection toolbar's size panel closed after one click. Focus now stays in the panel, as in LaTeX Visual. The test also checks Alt (0.5 pt) and Shift (10 pt) on the plus button. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… whole Only the line break or space next to a style change lost the size, bold, italic or strike, so deleting the text before two sized line breaks wrote the second one inside the span and the edit was refused. The rule now repeats until the whole run of whitespace is outside. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… position On macOS, Cmd+Shift reports the unshifted character, so the bindings on ">" and "<" never matched on a Mac (Cmd+Shift+, even reached Cmd+,). Writing strokes now name punctuation by its physical key under Ctrl, Cmd or Alt, as they already did for digits and as the app's own shortcuts do. The tests send the events a Mac sends, including a French layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Corrections before merge, pushed on the same branch (15 commits after b5eef10; still based on Fixes
Answer to my own open question
Known limits added
Additions
Checked (2026-11-22, on the branch head 56b4d68)
Found, not fixed (your call)
|
What Changed
Text > Font / Sizein the Markdown and LaTeX Visual editors, same labels and order. Size is a number in points (1 to 100) with minus and plus buttons and a list of common sizes; it applies to the word under a caret, closes on Enter, and shows an empty field for a mixed selection, where minus and plus move each word by 1 pt.Mod+Shift+.andMod+Shift+,(by key position) step the size. Fonts come from one catalogue, are shown in their own face in a searchable list that scrolls inside its panel. Document settings set the whole document's font and base size.Storage: Markdown
<span style="font-size:12pt">and<span style="font-family:'Times New Roman'">, always outside bold, italic, strikethrough and links; front matterfontsizeandmainfont. LaTeX{\fontsize{N}{M}\selectfont …},\fontfamily{code}\selectfontor a guarded\fontspec;fix-cmadded once for exact sizes in pdfLaTeX.Whitespace rule (Markdown): a space or line break where the styles change carries no bold, italic, strikethrough, size or family, in the writer and in the round-trip guard. This also changes bold, italic and strikethrough: a space typed after a bold word and bold removed from the last word of a paragraph are no longer refused. Font commands skip inline code.
Exports: PDF keeps the exact forms through the sanitizer; Word gets one character style per used size and font ("12 pt", "Times New Roman 12 pt"), sizes rounded to half points, Hebrew through the complex-script font; a LaTeX document's base font and size follow its preamble (10 pt by default).
Why
Sizes by name and three generic families are too coarse for papers that must use a given font and size. Numbers in points match Word, PDF and LaTeX.
Documentation Impact
Updated:
docs/user/markdown.md,docs/user/latex.md,docs/internals/scient-rich-markdown-editor.md.UI Changes
Screenshots to add (light and dark, Markdown and LaTeX): the Font / Size panel.
Checklist
Model and harness: Claude Sonnet 5.5 and Claude Opus 5.5, Claude Code.
🤖 Generated with Claude Code