Skip to content

refactor(tui): fold structure blocks to tags in read mode - #134

Open
Ariestar wants to merge 1 commit into
tui/theme-configfrom
tui/content-mode-unify
Open

refactor(tui): fold structure blocks to tags in read mode#134
Ariestar wants to merge 1 commit into
tui/theme-configfrom
tui/content-mode-unify

Conversation

@Ariestar

@Ariestar Ariestar commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Purpose

Read mode now collapses every structure part to its <:…:>\ tag line (<:tool:Bash call:>, <:thinking:>, …) instead of a plain channel summary (\ ools: Bash x2). Raw mode keeps the complete block. Both modes render the tags with the same gray style — read and raw share styling, not content.

Changes

  • \structured_parts_text\ emits each part's open-marker tag instead of channel summaries; \collapse_structure_markers\ and its dead styling are deleted.
  • Content labels become
    ead\ /
    aw.

Validation

  • \cargo test --workspace\ (332 + 205), clippy -D warnings, \cargo fmt --check\ pass; workspace tests rewritten to assert read shows tags only (payloads dropped) and raw shows full blocks.

Summary by CodeRabbit

  • Improvements
    • Updated reading mode to display each tool and skill structure marker individually and in dialogue order.
    • Preserved non-structure text while omitting structure payloads in reading mode.
    • Simplified content mode labels to “read” and “raw.”
    • Updated help text and workspace titles to reflect the revised terminology.
  • Bug Fixes
    • Removed outdated fold-summary styling and aggregation behavior in reading mode.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: eeb4eb5e-e52c-4e08-8389-aa320bd46915

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • No files to review - (🔄 Check again to try again)

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: bf249030-75e8-4468-8035-09123a760638

📥 Commits

Reviewing files that changed from the base of the PR and between e8789f5 and 9a7622d.

📒 Files selected for processing (5)
  • src/tui/content/markdown.rs
  • src/tui/content/text.rs
  • src/tui/content/view.rs
  • src/tui/workspace/help.rs
  • src/tui/workspace/tests.rs

Included review availability: Your plan includes up to 3 reviews per rolling hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Reading mode now emits individual structure markers in dialogue order and omits their payloads. Markdown no longer detects fold summaries. Content mode labels and help text now use read and raw.

Changes

Reading-mode content

Layer / File(s) Summary
Structure marker handling
src/tui/content/markdown.rs
Markdown parsing now styles only channel structure markers. Fold-summary detection and its test were removed.
Individual structure rendering
src/tui/content/text.rs, src/tui/workspace/tests.rs
Reading mode emits one label per structure part, preserves order and assistant text, and omits tool payloads.
Content mode labels
src/tui/content/view.rs, src/tui/workspace/help.rs, src/tui/workspace/tests.rs
Mode labels and help text now use read and raw. Workspace title expectations were updated.

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

Merge Risk: ⚪ Minimal · up to 9a762

Read mode now shows structure tags while raw mode retains full blocks, with updated tests and checks passing; no actionable merge-blocking risk remains.

Possibly related PRs

  • Ariestar/sivtr#133: Both PRs change reading-mode structure rendering and its workspace tests.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main TUI change: collapsing structure blocks into tags in read mode.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tui/content-mode-unify

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

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 13, 2026

Copy link
Copy Markdown

Deploying sivtr with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7380125
Status: ✅  Deploy successful!
Preview URL: https://84f5f7e2.sivtr.pages.dev
Branch Preview URL: https://tui-content-mode-unify.sivtr.pages.dev

View logs

@Ariestar
Ariestar force-pushed the tui/content-mode-unify branch from 6aeeee1 to f64b4cd Compare August 13, 2026 07:18
@Ariestar Ariestar changed the title refactor(tui): drop structure folding, read and raw share full payloads refactor(tui): fold structure blocks to tags in read mode Aug 13, 2026

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f64b4cd7eb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/tui/content/text.rs
@Ariestar
Ariestar force-pushed the tui/content-mode-unify branch from f64b4cd to 9a7622d Compare August 14, 2026 09:47
@Ariestar
Ariestar marked this pull request as ready for review August 14, 2026 09:48
Read mode now collapses every structure part to its <:...:> tag line
(<:tool:Bash call:>, <:thinking:>, ...) instead of a plain channel
summary (tools: Bash x2) and instead of the full payload. Raw mode keeps
the complete block. Both modes render the tags with the same gray style.

Deletes the channel-summary fold machinery and its dead styling; content
labels become read/raw.
@Ariestar
Ariestar force-pushed the tui/content-mode-unify branch from 9a7622d to 7380125 Compare August 16, 2026 05:25
@Ariestar
Ariestar force-pushed the tui/content-mode-unify branch from 605eb18 to 7380125 Compare August 16, 2026 09:19
@Ariestar
Ariestar requested a review from shiro123444 August 16, 2026 09:57
@Ariestar

Copy link
Copy Markdown
Owner Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown
⚠️ Action not completed

No files to review.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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