Skip to content

Standard view: start the gray marker box at the marker - #57

Open
Sebastian-ubs wants to merge 1 commit into
mainfrom
standard-view-gray-box-indent
Open

Sebastian-ubs wants to merge 1 commit into
mainfrom
standard-view-gray-box-indent

Conversation

@Sebastian-ubs

@Sebastian-ubs Sebastian-ubs commented Nov 19, 2026 •

Copy link
Copy Markdown

Note

Paired with paranext/paranext-core#3035, which makes the same fix in paranext-core's vendored copies of this stylesheet and has the before/after screenshots and measurements from the app.

Code Review Summary

Branch: standard-view-gray-box-indent

Base: origin/main

Date: 2026-11-19

Review model: Claude Opus 5.5

Files changed: 3

Overview

In Standard view, the read-only gray box drawn around content the editor does not edit directly (\fig, sidebars, \periph, …) inherited its paragraph's first-line text-indent, which a block box applies to its own first line. Under \q (-10vw) the opening \fig glyph was drawn past the box's left edge; under \p it started after an extra gap. The branch adds text-indent: 0 to .marker-editable .unknown-block in packages/platform/src/usj-nodes.css, pins it in usj-nodes.css.test.ts, and adds an Unreleased → Fixed entry to CHANGELOG.md. paranext-core carries the same fix in its vendored copies (paranext/paranext-core#3035).

The analysis found no critical or important issues. The minor findings are about the new test's wording and robustness.

API Changes

None. No TypeScript exports changed, so the extract-api report is unaffected. The stylesheet is not part of dist/. No selector or class name was added, renamed or removed; the only effect is how the box's first line is laid out in Standard view.

Findings

Critical — Must address before merge

None.

Important — Should address before merge

None.

Minor — Consider

  • The pin only matches one exact spelling. /\.marker-editable \.unknown-block\s*\{[^}]*text-indent: 0;/ fails on text-indent:0; or 0px. The empty-verse block in the same file collapses whitespace first. Suggested: match the whitespace-collapsed sheet, or loosen to text-indent:\s*0(px)?\s*;.
  • The new block repeats the stylesheet read and comment-strip. Consistent with the rest of the file, but this is now the third copy of the comment-strip regex. A module-level css / cssWithoutComments would remove the duplication; arguably out of scope here.
  • The test comment nearly repeats the stylesheet comment. The two could drift apart. Suggested: keep only what the test adds (the -10vw example) and point at the rule's comment.
  • The new block doesn't mention the vendored-copy contract. Neighbouring blocks note that paranext-core vendors this sheet, so their strings are a contract. A one-line note would keep the new block consistent.
  • Inherited text-indent: 0 also reaches content nested in the box (sidebar, \periph); check that inner \p/\q keep their own indents. (Checked in the app through paranext-core: \p and \q inside an \esb sidebar keep their own first-line and hanging indents, at identical positions with and without the fix. Screenshot in Standard view: start the gray marker box at the marker paranext-core#3035.)
  • The test checks stylesheet text only and can't prove the layout, since jsdom does no layout. (Informational; same limit as every other block in the file. The layout was verified in the app through paranext-core, with measurements in Standard view: start the gray marker box at the marker paranext-core#3035.)

No author response: the interview was not run (see Interview Notes).

Template Propagation

Shared Regions Modified

None. Neither changed source file has a #region shared with marker. paranext-core's vendored copies are already updated in paranext/paranext-core#3035.

Extension Config Changes

None.

Positive Observations

  • One declaration on the only .marker-editable .unknown-block rule in the file, so it cannot leak into the formatted or markers views, where .unknown-block stays display: none.
  • text-indent has no left/right variant, so the reset behaves the same in right-to-left projects. Theming is untouched; the box still takes its colors from --muted-foreground.
  • The test strips comments before matching, so prose that mentions text-indent can't satisfy it, and [^}]* keeps the match inside the rule body. It fails without the fix and passes with it; usj-nodes.css.test.ts and usj-nodes.css.gutter-coverage.test.ts pass (19/19).
  • The CHANGELOG entry describes what users see, in the style of the surrounding entries. Comments explain the mechanism without ticket IDs, per this repo's CLAUDE.md.

Interview Notes

The author interview was not conducted. The author asked for both reviews to run and the results to be posted without stopping for discussion, so no findings have author responses and no design walkthrough was recorded.

Suggested Review Focus

AI-assisted — Claude Code (Claude Opus 5.5), CLI session; no session URL available


Summary

In Standard view, the dashed gray box around content the editor does not edit directly (\fig, sidebars, \periph, …) could start partway into its marker. The box inherited its paragraph's first-line text-indent, and a block box applies that to its own first line:

  • In a \q line (text-indent: -10vw), the opening \fig glyph was drawn past the box's left edge.
  • In an indented line such as \p, the glyph started after an extra gap.

paranext-core carries the same one-line fix in its vendored copy of this stylesheet, with before/after screenshots and measurements from the app: paranext/paranext-core#3035.

Changes

  • .marker-editable .unknown-block sets text-indent: 0 (packages/platform/src/usj-nodes.css).
  • usj-nodes.css.test.ts pins the rule.
  • CHANGELOG.md: entry under Unreleased → Fixed.

The stylesheet is not part of dist/, so there is no rebuilt dist/ in this PR.

Testing

  • The new test fails without the fix and passes with it; usj-nodes.css.test.ts and usj-nodes.css.gutter-coverage.test.ts pass (19/19).
  • Verified in Platform.Bible through the paranext-core copy (see #3035).

AI-assisted: Claude Code (Claude Opus 5.5) wrote the change and test. Reviewed by the author.

🤖 Generated with Claude Code


This change is Reviewable

The read-only gray box Standard view draws around content the editor
does not edit directly (\fig, sidebars, \periph, ...) inherited its
paragraph's first-line text-indent, which a block box applies to its own
first line. Inside a \q paragraph (text-indent: -10vw) the opening \fig
glyph was drawn past the box's left edge; inside an indented paragraph
such as \p it started after an extra gap. Reset text-indent on the box
and pin it in the stylesheet test.

paranext-core carries the same fix in its vendored copy:
paranext/paranext-core#3035

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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