Skip to content

fix(PT-4157): inline resource name keeps its ellipsis in narrow panes#2553

Merged
katherinejensen00 merged 3 commits into
mainfrom
pt-4157-inline-name-ellipsis
Jul 17, 2026
Merged

fix(PT-4157): inline resource name keeps its ellipsis in narrow panes#2553
katherinejensen00 merged 3 commits into
mainfrom
pt-4157-inline-name-ellipsis

Conversation

@katherinejensen00

@katherinejensen00 katherinejensen00 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • In verse-row mode the Scripture Text Grid shows a short hanging resource-name label before the verse text
  • When the pane was narrower than the label's 96 px width cap, the label overflowed and the truncation was rendered off-screen — leaving a hard-cut name with no ellipsis visible
  • Fix: swap tw:shrink-0tw:min-w-0 on the inline name label (one-line change)
  • Guard: add a VerseLongNameNarrowPane Storybook story (110 px pane, long name) as a permanent visual regression check

Details

The root cause

text-overflow: ellipsis only clips text within the element's own layout box. flex-shrink: 0 kept the label box at 96 px even when the pane was 70 px — the box physically overflowed the pane and the landed off-screen. min-width: 0 allows the flex item to shrink to the visible width, so the ellipsis always fires at the actual edge.

The clip-detecting tooltip (useTruncationTooltip) was already firing correctly; only the visible was missing.

Changed files

File Change
resource-cell-view.component.tsx Line 141: shrink-0min-w-0 on the inline label; added an explanatory JSX comment
resource-cell-view.component.stories.tsx New VerseLongNameNarrowPane story; CellBox helper extended with optional width prop

What was not changed

The header-mode label was already correct — it is a block element (not a flex item) so ellipsis works without min-w-0.

RTL note

The fix is direction-agnostic (min-width: 0 is not directional). The existing VerseLongNameRightToLeft story covers long RTL names at normal width; a narrow-pane RTL story would be a natural follow-up.

Suggested reviewer focus

  • VerseLongNameNarrowPane story: open it in Storybook and confirm the appears at the visible edge of the 110 px pane
  • VerseRightToLeft + VerseLongNameRightToLeft: verify RTL inline-start placement is unaffected

AI-assisted


This change is Reviewable

The verse-row inline name used a fixed-width, non-shrinking label
(max-w-24 shrink-0). In a verse pane narrower than the 96px cap, the
label overflowed the pane and its truncation ellipsis was pushed
off-screen, so a clipped name showed a hard cut with no "…" (per Tom's
review of #2541). Switch shrink-0 -> min-w-0 so the label still caps at
max-w-24 when there is room but shrinks to the visible width when the
pane is narrow, keeping the ellipsis at the visible edge.

Add a narrow-pane Storybook story as a visual/Chromatic guard (grid cell
layout is not measurable in jsdom), plus an optional `width` prop on the
local CellBox story helper to drive it.

Re-applied onto current main after the ScriptureTextGrid zoom/drag-handle
rewrite; the fix lands in the (unchanged) inline verse-row branch.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@katherinejensen00
katherinejensen00 force-pushed the pt-4157-inline-name-ellipsis branch from 82a7767 to d9f8906 Compare July 17, 2026 17:46
katherinejensen00 and others added 2 commits July 17, 2026 10:55
…rop "offline" wording

Fold in the cleanup from Tom's review of #2557, adapted to the current
ScriptureTextGrid file shapes:

- Alphabetize the `scriptureTextGrid_cell_*` localization keys within each
  contiguous run (en and es kept in sync), fixing the not_installed/
  unavailable and status_* ordering Tom flagged.
- Replace inaccurate "offline" wording in comments with accurate terms now
  that a real `unavailable` state exists: "status and action labels",
  "unavailable placeholder", "availability wiring", "non-ready cell", and
  drop the stray "offline" from the ScriptureTextGrid story blurb. Kept the
  one legitimate causal use ("failed to download (e.g. offline)").

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The ellipsis fix is direction-dependent (RTL truncates on the opposite,
inline-start/right edge), so guard the RTL half of the same bug with a
VerseLongNameNarrowPaneRightToLeft story mirroring the LTR narrow-pane case.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@tombogle tombogle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@tombogle reviewed 4 files and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved.

@katherinejensen00
katherinejensen00 merged commit c874e91 into main Jul 17, 2026
6 of 7 checks passed
@katherinejensen00
katherinejensen00 deleted the pt-4157-inline-name-ellipsis branch July 17, 2026 20:42
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