Skip to content

fix: improve ongoing question rendering#259

Merged
Nek-12 merged 4 commits into
mainfrom
fixes
May 14, 2026
Merged

fix: improve ongoing question rendering#259
Nek-12 merged 4 commits into
mainfrom
fixes

Conversation

@Nek-12

@Nek-12 Nek-12 commented May 14, 2026

Copy link
Copy Markdown
Member

Summary

  • Render ask_question groups separately from other tools in ongoing transcript
  • Preserve model-call order for grouped questions and answers
  • Render question markdown consistently in ongoing transcript and inline prompts
  • Keep inline picker/freeform prompts full and wrapped; ellipsize only pending live-area question previews
  • Preserve literal freeform answers and remove faint styling from question text

Verification

  • ./scripts/test.sh ./cli/tui ./cli/app ./server/tools/askquestion
  • ./scripts/test.sh ./...
  • ./scripts/build.sh --output ./bin/builder
  • git diff --check
  • git push pre-push hook (format, vet, build, test)

Summary by CodeRabbit

  • New Features
    • Ask-question prompts render markdown inline (styled output without raw markers) and use a width-aware renderer to produce wrapped/plain variants.
  • Bug Fixes
    • Picker and freeform question text now wrap across lines instead of being ellipsized; pending-question previews still truncate with ellipsis.
    • Cursor placement remains correct after markdown expansion.
    • Freeform answers shown without added prefixes.
  • Tests
    • Added/updated tests covering markdown rendering, wrapping, cursor behavior, and ongoing/pending ask-question UI.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 14, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@Nek-12 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 51 minutes and 48 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b2d477b4-0e5e-4903-a028-56309c04591b

📥 Commits

Reviewing files that changed from the base of the PR and between bd8e395 and 02b9e73.

📒 Files selected for processing (1)
  • cli/tui/model_rendering_tools.go
📝 Walkthrough

Walkthrough

Preprocess consecutive ask-question prompt lines by rendering them as inline markdown before layout wrapping; add theme/width-backed helpers for ask-question rendering; change pending ask-question preview to a single markdown-first truncated line; and add tests for wrapping, ellipsizing, rendered output, and cursor placement.

Changes

Ask-question prompt rendering and pending UI

Layer / File(s) Summary
Ask-question render helpers and divider normalization
cli/tui/model_rendering_tools.go
Normalize RenderIntentToolQuestion/RenderIntentToolQuestionError to the "question" divider group; add RenderAskQuestionMarkdownLines and RenderInlineAskQuestionMarkdownLines (width clamping, zero-width edge trimming, fallback splitting); switch ask-question rendering to use the wrapped renderer path.
Pending spinner: single-line markdown-first preview
cli/tui/pending_snapshot.go
Add bounds check in applyPendingSpinner. Replace ask-question pending rendering with flattenPendingAskQuestionEntryWithSymbol which renders inline markdown, picks the first non-empty line (fallback "ask question"), truncates to render width with optional ellipsis, and prepends entry prefix when present.
UI tests for markdown expansion, wrapping, and cursor behavior
cli/app/ui_test.go
Update TestAskQuestionLargeMarkdownPromptPreservesLogicalLines to assert no raw markdown markers and presence of expected rendered elements; add tests asserting long picker/freeform questions wrap instead of ellipsizing and that cursor projections place the cursor on the input line after markdown expansion.

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: improve ongoing question rendering' directly relates to the main changes in the PR, which focus on improving how ask_question tool prompts are rendered in the ongoing transcript, including markdown rendering, wrapping, and ellipsizing behavior.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fixes

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 and usage tips.

@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: 76dcb2888a

ℹ️ 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 cli/app/ui_layout_rendering_input.go

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
cli/tui/model_rendering_tools.go (1)

109-132: ⚡ Quick win

Add documentation comments for exported functions.

Both RenderAskQuestionMarkdownLines and RenderInlineAskQuestionMarkdownLines are exported but lack documentation comments. Go convention requires all exported functions to have doc comments describing their purpose, parameters, and behavior.

📝 Suggested documentation
+// RenderAskQuestionMarkdownLines renders an ask-question prompt as markdown-formatted
+// display lines using the provided theme and width, applying hard wrapping for overflow.
 func RenderAskQuestionMarkdownLines(question string, theme string, width int) []string {
 	renderer := transcriptProjectionRenderer(theme, width, 0)
 	return renderer.renderAskQuestionMarkdownLines(RenderIntentToolQuestion, question, width)
 }
 
+// RenderInlineAskQuestionMarkdownLines renders an ask-question prompt as inline markdown,
+// trimming zero-width edge lines and falling back to simple line splitting when markdown
+// rendering is unavailable or produces no output.
 func RenderInlineAskQuestionMarkdownLines(question string, theme string, width int) []string {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cli/tui/model_rendering_tools.go` around lines 109 - 132, Add Go doc comments
for the two exported functions RenderAskQuestionMarkdownLines and
RenderInlineAskQuestionMarkdownLines: for each, add a comment immediately above
the function that briefly describes what the function does, the meaning of its
parameters (question, theme, width), and the returned value (slice of
markdown-rendered lines), and note any special behavior (e.g.,
RenderInlineAskQuestionMarkdownLines falls back to splitting the raw question
when markdown rendering is unavailable and ensures width >= 1). Ensure the
comments follow Go convention ("FunctionName ...") and are concise.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@cli/tui/model_rendering_tools.go`:
- Around line 109-132: Add Go doc comments for the two exported functions
RenderAskQuestionMarkdownLines and RenderInlineAskQuestionMarkdownLines: for
each, add a comment immediately above the function that briefly describes what
the function does, the meaning of its parameters (question, theme, width), and
the returned value (slice of markdown-rendered lines), and note any special
behavior (e.g., RenderInlineAskQuestionMarkdownLines falls back to splitting the
raw question when markdown rendering is unavailable and ensures width >= 1).
Ensure the comments follow Go convention ("FunctionName ...") and are concise.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3e950c73-a5dd-4f22-addd-1b0abf205472

📥 Commits

Reviewing files that changed from the base of the PR and between 76dcb28 and bd8e395.

📒 Files selected for processing (5)
  • cli/app/ui_layout_rendering_input.go
  • cli/app/ui_test.go
  • cli/tui/model_rendering_tools.go
  • cli/tui/model_test.go
  • cli/tui/pending_snapshot.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • cli/app/ui_layout_rendering_input.go
  • cli/tui/model_test.go

@Nek-12 Nek-12 enabled auto-merge (squash) May 14, 2026 21:03
@Nek-12 Nek-12 merged commit cbbaba4 into main May 14, 2026
6 checks passed
@Nek-12 Nek-12 deleted the fixes branch May 14, 2026 21:04
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