8000 The page: Literata, a reading measure and the Status line by kiran-brahma · Pull Request #83 · kiran-brahma/writing-tool · GitHub
[go: up one dir, main page]

Skip to content

The page: Literata, a reading measure and the Status line - #83

Merged
kiran-brahma merged 2 commits into
v1.3from
v1.3-63
Sep 26, 2026
Merged

kiran-brahma merged 2 commits into
v1.3from
v1.3-63

Conversation

@kiran-brahma
@kiran-brahma kiran-brahma commented Sep 26, 2026 •
Copy link
Copy Markdown
Owner

Part of #57. Closes #63.

What changed

  • Literata comes from the OFL package @fontsource-variable/literata (weight axis, upright and italic), imported in src/index.css. Vite bundles the woff2 files into /assets/, so they're served from Obelus's own origin. The stack is "Literata Variable", Georgia, "Times New Roman", serif and is exposed as a font-page utility.
  • The page: prose at 18px with line-height 1.6. Headings scale in em in the same family. A shared .obelus-column class holds the prose to about 68 characters and centres it, and the title, toolbar and Status line use it too so all four line up. The scroller reserves its scrollbar gutter on both sides, so a scrollbar never pushes the column off-centre.
  • Title moves to the head of the column, set in Literata. It still commits on blur or Enter.
  • Toolbar: quieter styling, aligned with the column, and has role="toolbar". Undo and Redo are gone. StarterKit's history and Markdown input rules are unchanged.
  • Status line (src/editor/StatusLine.tsx): sits under the prose at every width and sticks to the foot of the window. It shows document.wordCount (the same count the Library and Revisions use), formatted by the new pure wordCountLabel, which has a test. It isn't a live region.
  • Document menu keeps only Import and Export. The word count has moved to the Status line (story 200), and the wordCount prop is gone.
  • Status line is added to CONTEXT.md.
  • Rebased onto v1.3 after Header destinations and the Callout's verdicts #68 merged. The header's structure from Header destinations and the Callout's verdicts #68 is intact.
  • Service worker: no change. public/sw.js precaches only the /assets/ URLs found in index.html. The fonts are referenced from CSS, so they aren't precached. They are cached at runtime: request destination font under /assets/, cache-first. The prune that runs on each online navigation removes them, and the page then fetches and caches them again.
  • The CSP is unchanged. There's no Dexie migration, the findings schema is unchanged, and no DOM test layer was added.

Acceptance criteria

  • No request leaves the browser for a font, and the CSP is unchanged. Verified: I recorded every request with headless Chromium, against pnpm preview and against pnpm dev. Nothing went off-origin. The only font request was /assets/literata-latin-wght-normal-*.woff2 on the same origin. worker/securityHeaders.ts is untouched.
  • Prose lines stay near 68 characters at 1440px and wider. Verified: I counted characters on each rendered line of a long paragraph. At 1440, 1920 and 2560px the lines were 61 to 71 characters (mean 66.9), in a 592px column.
  • With the font blocked, prose renders in Georgia. Partly verified: with the woff2 blocked, Literata never loads and the prose falls through to the stack, which lists Georgia next. Georgia isn't installed on this Linux container, so Chromium showed the next fallback, Liberation Serif, which it uses for Times New Roman. I couldn't see Georgia itself here.
  • The title edits in place in the column, commits on blur or Enter, as today. Verified in Chromium: the field blurs on Enter, and a title committed on blur appears in the Library.
  • Toolbar has headings, bold, italic, inline code, lists and quote; no Undo/Redo; ⌘Z still works. Verified: the toolbar holds exactly H1, H2, H3, Bold, Italic, Inline code, Bulleted list, Numbered list and Block quote. Ctrl+Z undid typed text in headless Linux. I didn't test ⌘Z on a Mac, but it's the same StarterKit keymap. The Markdown shortcuts still work.
  • The Status line shows the word count and updates as the Writer types. Verified: it went from 10 to 13 words after typing three words. It updates after the one-second typing pause. With the menu open, the Document menu shows only "Import Markdown" and "Export Markdown".
  • Checked by eye in both schemes at 1024 and 1440px. Verified from screenshots of light and dark at each width, before and after the rebase onto Header destinations and the Callout's verdicts #68's header. I didn't check 375px: phone layouts are out of scope and the ticket doesn't list it.

Notes for review

  • Literata's OFL licence ships in the npm package. The built dist/ contains the woff2 files but no separate licence file.

🤖 Generated with Claude Code

@chatgpt-codex-connector
chatgpt-codex-connector Bot commented Sep 26, 2026 •
Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-09-26T10:27:40.348357Z e6ed81a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

The Writer's prose is set in Literata, bundled from the OFL
@fontsource-variable/literata package so Vite serves its woff2 from
/assets/ on Obelus's own origin; Georgia is the fallback. The prose is
18px with line-height 1.6, headings scale in em in the same family, and
the column holds about 68 characters, centred.

The Document title moves to the head of the column in the page's
typeface and still commits on blur or Enter. The toolbar aligns with the
column, is quieter, and drops Undo and Redo; the history and Markdown
input rules are StarterKit's, unchanged. A Status line beneath the prose
shows the word count at every width, from the new pure wordCountLabel.
Status line is added to CONTEXT.md.

Part of #57.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FjB3Gu8vhg5enkAneTdqga
The Status line carries the word count at a glance, so the Document
menu keeps only Import and Export (story 200). The prop that served the
menu's count goes with it.

Part of #57.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FjB3Gu8vhg5enkAneTdqga
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

0