Skip to content
This repository was archived by the owner on Aug 17, 2026. It is now read-only.

fix(grunt/tui): TicketHoverCard text-rendering — clean preview lines, no character bleed - #17

Merged
terrxo merged 1 commit into
devfrom
grunt-fix/ticket-hover-card-text-rendering
May 27, 2026
Merged

terrxo merged 1 commit into
devfrom
grunt-fix/ticket-hover-card-text-rendering

Conversation

@terrxo

@terrxo terrxo commented May 27, 2026

Copy link
Copy Markdown

Closes hivemind anomalyco#233 (text rendering nit after PR #16 landed shadcn-style positioning).

Nik feedback

Screenshot showed title rendered as 'gibberish' — actual: ##nNikrdirectiveo2026-05-26T23:01Zd(recoveredafromrd on (correct source: ## Nik directive 2026-05-26T23:01Z (recovered from ses_...)). Scope rendered with characters from the 'click to open in hivemind-ui' footer line bleeding INTO the scope text.

Three causes compounding

  1. wrapMode='word' on adjacent <text> siblings joins them across line boundaries in opentui — characters bleed between lines.
  2. Markdown chars in scope — full scope contained ## heading syntax, blank-line gaps, emphasis markers. Plain-text renderable passed them through; word-wrap mangled the spaces around # glyphs.
  3. Fragment wrapper — no layout box → renderable free to interleave children.

Fix

  • Wrap inner content in <box flexDirection='column'> (one explicit line per <text>)
  • Drop wrapMode='word' — natural per-text bounds work fine
  • Pre-flatten the scope before render: strip code fences, headings, emphasis markers; collapse all whitespace to single spaces. Makes the tooltip a proper one-paragraph preview instead of trying to render markdown inside a 60-col card.
  • Compute title / meta / scope-preview as plain strings
  • Replace <b>...</b> with attributes={1} on the title <text> (matches existing sidebar.tsx pattern)

Verified

bun typecheck clean. Local install reports 1.15.10-grunt.7+local.f9cad9dea.dirty.

… no character bleed

Refs hivemind anomalyco#233. Closes Nik feedback after PR #16: 'there is some
gibberish being added in to text' with a screenshot showing the title
rendered as '##nNikrdirective...' (jumbled) and the scope as
'clicktto,open inrhivemind-ui closed the session before' (with extra
letters and the footer-line text bleeding into the scope).

## Root cause

Three compounding issues in the card body:

1. **Multi-line scope text with wrapMode='word'** — opentui's text renderable
   joins adjacent <text> siblings when wrap-word is enabled, producing
   character bleed across line boundaries. The actual title was correct
   in the api response; the renderer was conflating it with the scope's
   first line plus the footer ('click to open in hivemind-ui') text.

2. **Markdown chars in scope** — full scope text contains markdown
   ('## Nik directive 2026-05-26T23:01Z (recovered from ses_...)') which
   the plain-text renderable was passing through verbatim, then word-wrap
   ate the spaces around '#' and '##'.

3. **<>Fragment</> wrapping the inner content** — Fragments don't
   establish a layout box; the renderable was free to flow children in
   weird ways. The position-absolute outer box wasn't enough to constrain
   line breaks per-text.

## Fix

- Wrap inner content in <box flexDirection='column'> so each <text> is
  one explicit line.
- Drop wrapMode='word' from the body; let opentui's natural per-text
  layout handle line bounds.
- Pre-flatten the scope: strip code fences, headings, emphasis markers,
  and collapse whitespace to single spaces. This makes the preview a
  proper one-paragraph blurb instead of attempting to render markdown
  inside a 60-col tooltip.
- Compute title / meta / scope-preview as plain strings before render.
- Drop the <b> wrapper around title (use attributes={1} on <text> instead,
  matching the pattern in routes/session/sidebar.tsx).

## Verified

bun typecheck clean. Local install reports
1.15.10-grunt.7+local.f9cad9dea.dirty.
@terrxo
terrxo merged commit 0d4a394 into dev May 27, 2026
@terrxo
terrxo deleted the grunt-fix/ticket-hover-card-text-rendering branch May 27, 2026 00:52
@github-actions

Copy link
Copy Markdown

Hey! Your PR title fix(grunt/tui): TicketHoverCard text-rendering — clean preview lines, no character bleed doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

terrxo added a commit that referenced this pull request May 28, 2026
… no character bleed (#17)

Refs hivemind anomalyco#233. Closes Nik feedback after PR #16: 'there is some
gibberish being added in to text' with a screenshot showing the title
rendered as '##nNikrdirective...' (jumbled) and the scope as
'clicktto,open inrhivemind-ui closed the session before' (with extra
letters and the footer-line text bleeding into the scope).

## Root cause

Three compounding issues in the card body:

1. **Multi-line scope text with wrapMode='word'** — opentui's text renderable
   joins adjacent <text> siblings when wrap-word is enabled, producing
   character bleed across line boundaries. The actual title was correct
   in the api response; the renderer was conflating it with the scope's
   first line plus the footer ('click to open in hivemind-ui') text.

2. **Markdown chars in scope** — full scope text contains markdown
   ('## Nik directive 2026-05-26T23:01Z (recovered from ses_...)') which
   the plain-text renderable was passing through verbatim, then word-wrap
   ate the spaces around '#' and '##'.

3. **<>Fragment</> wrapping the inner content** — Fragments don't
   establish a layout box; the renderable was free to flow children in
   weird ways. The position-absolute outer box wasn't enough to constrain
   line breaks per-text.

## Fix

- Wrap inner content in <box flexDirection='column'> so each <text> is
  one explicit line.
- Drop wrapMode='word' from the body; let opentui's natural per-text
  layout handle line bounds.
- Pre-flatten the scope: strip code fences, headings, emphasis markers,
  and collapse whitespace to single spaces. This makes the preview a
  proper one-paragraph blurb instead of attempting to render markdown
  inside a 60-col tooltip.
- Compute title / meta / scope-preview as plain strings before render.
- Drop the <b> wrapper around title (use attributes={1} on <text> instead,
  matching the pattern in routes/session/sidebar.tsx).

## Verified

bun typecheck clean. Local install reports
1.15.10-grunt.7+local.f9cad9dea.dirty.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant