Skip to content

Fix 'ltr'/'rtl' text appearing visibly in item content#45

Merged
cubny merged 3 commits into
masterfrom
fix/item-dir-text-visible
May 13, 2026
Merged

Fix 'ltr'/'rtl' text appearing visibly in item content#45
cubny merged 3 commits into
masterfrom
fix/item-dir-text-visible

Conversation

@cubny

@cubny cubny commented May 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • ItemRow.js had a <div class="dir">${dir}</div> that rendered the text-direction value (ltr or rtl) as visible text in every item
  • Fixed by removing that div and moving dir=${dir} as an attribute on the existing .desc div, which is the correct semantic placement

Test plan

  • Open the app and verify no "ltr" text appears above item descriptions
  • Verify RTL content still renders with correct text direction

🤖 Generated with Claude Code

The dir value was rendered as a text node inside a <div class="dir">
instead of being set as an HTML attribute. Move dir onto the .desc div
where it belongs for correct RTL/LTR text-direction control.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Copilot AI 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.

Pull request overview

Fixes an item-list UI issue where the text direction value (ltr/rtl) was being rendered as visible content by moving direction handling to a semantic dir attribute on the description container.

Changes:

  • Removed the dedicated .dir element that displayed ltr/rtl as text.
  • Applied dir=${dir} directly to the existing .desc element.

</div>
<div class="dir">${dir}</div>
<div class="desc" dangerouslySetInnerHTML=${{ __html: item.desc || '' }}></div>
<div class="desc" dir=${dir} dangerouslySetInnerHTML=${{ __html: item.desc || '' }}></div>
cubny and others added 2 commits May 13, 2026 19:32
- Guard against nil PublishedParsed/UpdatedParsed to prevent nil deref panic
  on feeds like BBC Persian that omit <pubDate>
- Fall back from Content to Description for Desc, so feeds that only use
  <description> (not <content:encoded>) show their body text
- Compute Dir as "rtl"/"ltr" via unicode range detection instead of storing
  the raw description text (which was a copy-paste bug)
- Fix silent test assertions (ObjectsAreEqualValues was discarded) and
  correct the stale expected values they were hiding

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ble text

Verifies that the .desc div carries a dir attribute (ltr/rtl) and that
no standalone direction token appears as text content in an item row.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cubny

cubny commented May 13, 2026

Copy link
Copy Markdown
Owner Author

Added a Playwright test in tests/ui/items.spec.js (should not render direction token as visible text in item description) that: expands an item row, asserts the .desc div has a dir attribute of ltr or rtl, and asserts no standalone direction token appears as text content. All 22 UI tests pass.

@cubny cubny merged commit 0d811eb into master May 13, 2026
9 checks passed
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