Skip to content

Typeset workspace prose with Justif - #7

Open
maceip wants to merge 1 commit into
mainfrom
exp/typesetting-justif
Open

Typeset workspace prose with Justif#7
maceip wants to merge 1 commit into
mainfrom
exp/typesetting-justif

Conversation

@maceip

@maceip maceip commented Sep 6, 2026

Copy link
Copy Markdown
Owner

What

Markdown paragraphs in the transcript and discussion are set with Justif (MIT): Knuth–Plass line breaking over the whole paragraph, TeX hyphenation, punctuation hung into the margin, glyph protrusion at the edges. The browser's one-line-at-a-time justification leaves rivers and loose lines; this sets a paragraph the way a book is set.

  • Streaming turns stay ragged (text-wrap: pretty) until they settle, so text doesn't reflow under the reader; typeset the moment the turn completes
  • Teasers and labels keep the browser's breaker (two-line card blurbs were hyphenating "exist-ing"); headings get text-wrap: balance
  • Prose is keyed by content so Justif and React never edit the same nodes
  • Found and fixed: overflow-wrap: anywhere on the prose container let the browser take emergency breaks that undid Justif's plan around inline code; justified blocks now set overflow-wrap: normal

Look at

  • docs/design/typesetting.md
  • ui/src/typeset.tsx (the typeset() helper, useTypeset, Typeset)
  • npm run demo:ui, post a two-paragraph comment with inline code, resize the window

Verification

npm run check and npm run test:ui pass.

Landing

Adjacent-line conflicts with siblings in THIRD_PARTY_NOTICES.md / scripts/ui-notices.mjs only.

Markdown paragraphs in the transcript and discussion are now set with
Knuth-Plass line breaking, TeX hyphenation, hanging punctuation and glyph
protrusion (Justif, MIT). Streaming turns stay ragged until they settle so
text does not reflow under the reader; teasers and labels keep the browser's
`text-wrap: pretty`, headings balance.

- Prose is keyed by content so Justif and React never edit the same nodes
- Justified blocks disable overflow-wrap emergency breaks, which were undoing
  planned breaks around inline code
- Justif's license joins the bundled UI license texts
- docs/design/typesetting.md explains the boundaries and next surfaces
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 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
📝 Code Review Completed 2026-09-06T22:12:29.677758Z ae3fea6 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

<Prose text={part.content} />

P2 Badge Keep streaming reasoning ragged until completion

When a provider streams agent_thought_chunk updates and the user expands the reasoning disclosure during the active turn, this Prose defaults to settled=true, so every chunk remounts the content and reruns Justif. Unlike the markdown branch above, this makes the visible text continually reflow while streaming; pass the same active-turn settled flag here.

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ui/src/style.css
.typeset code {
hyphens: none;
-webkit-hyphens: none;
overflow-wrap: normal;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve emergency wrapping for long inline code

When settled Markdown contains an inline code token longer than the available line, this higher-specificity rule overrides the existing code { overflow-wrap: anywhere } fallback while also disabling hyphenation. Such a token cannot wrap, and the transcript's .contribution-content container uses overflow: hidden, so its tail is clipped on narrow panes; retain an emergency wrapping path for unbreakable code that Justif cannot set.

Useful? React with 👍 / 👎.

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