Skip to content

Add Unicode text nodes for terminal apps - #1

Merged
IGN-Styly merged 5 commits into
mainfrom
feat/text-widget
Oct 14, 2026
Merged

IGN-Styly merged 5 commits into
mainfrom
feat/text-widget

Conversation

@IGN-Styly

@IGN-Styly IGN-Styly commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

Adds a plain Text node so terminal apps can render chat messages, lists, and input fields using the existing layout and renderer. Text clips by terminal cell width, keeps combining marks and wide glyphs intact, and filters control characters. Border titles now use the same safe text layout.

This supports the qmsg TUI. The crate and repository names stay fxcode; a rename to fxui can happen separately.

Validation: cargo test passes (11 tests; 2 optional mpv tests ignored). The existing media tests require docs/cars.mp4, which is absent from the repo; I supplied a generated one-second video locally for the test run. New tests cover Unicode clipping, control characters, and the right edge.

Used by qmsg PR #15. See the rendered chat demo (S9 file server; requires Tailscale). The consumer PR includes the matching before/after terminal captures.

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bf24acb8-ebf8-40ec-864c-a724c20fcc06
📥 Commits

Reviewing files that changed from the base of the PR and between 56525dd and 9e5a754.

📒 Files selected for processing: 1
  • src/mpv.rs
 ___________________________________________________________________________________________________________________________________
< Don't use manual procedures. A shell script or batch file will execute the same instructions, in the same order, time after time. >
 -----------------------------------------------------------------------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 73540967-8da9-4dc9-862f-3acdf859c78e
📥 Commits

Reviewing files that changed from the base of the PR and between c44f497 and 56525dd.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • Cargo.toml
  • README.md
  • src/lib.rs
  • src/renderer.rs
  • src/tree.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The PR adds a public Text node with style and color options. The renderer paints text and titles with grapheme-aware clipping and terminal-cell width handling. The README documents text layout and handling.

Changes: Text rendering

Layer / File(s) Summary
Text node API
src/tree.rs, src/lib.rs
Node supports Text. The public Text type provides content, style, and color, and converts into Node. The crate re-exports Text.
Grapheme-aware painting
Cargo.toml, src/renderer.rs, README.md
The renderer paints text and titles using grapheme display widths, filters control characters, clips to available cells, and handles wide-glyph continuation cells. Dependencies, documentation, and tests support this behavior.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to 56525

The new text rendering behavior has no identified merge-blocking issue. Normal checks remain appropriate.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 3 files. (2 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes the main change: adding Unicode-aware text nodes for terminal applications.
Full details: Docstring Coverage

Explanation

Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 3 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

mpv unloaded a file when it finished, so seeking or replaying afterwards
failed. fxcode stored that failure as a fatal player error, which ended
the whole render loop. Keep the file open at its end without pausing,
and treat a failed seek as a no-op.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IGN-Styly and others added 2 commits October 14, 2026 12:30
seek_to stores the target as the position right away, so the regression
test passed before the control thread applied the seek, and even when
set_position was never called. Replace that optimistic value with a
sentinel, so only a time-pos refresh from libmpv can satisfy the check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep videos open at their end and survive failed seeks
@IGN-Styly
IGN-Styly merged commit c590432 into main Oct 14, 2026
1 of 2 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.

1 participant