Skip to content

Add a patch to make thinking blocks italic and dim again#369

Merged
bl-ue merged 5 commits intomainfrom
thinking-style-patch
Jan 16, 2026
Merged

Add a patch to make thinking blocks italic and dim again#369
bl-ue merged 5 commits intomainfrom
thinking-style-patch

Conversation

@bl-ue
Copy link
Member

@bl-ue bl-ue commented Jan 12, 2026

Resolves #353 (comment)

Summary by CodeRabbit

  • New Features
    • Restores and enhances the visual styling of the thinking indicator—now rendered with dimmed, italicized presentation for improved readability and presentation consistency.
    • Adds a release-note entry documenting the thinking-label styling update.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 12, 2026

📝 Walkthrough

Walkthrough

Adds a new patch module that rewrites the "∴ Thinking…" label into styled Box/Text createElement calls and wires that patch into the existing patch pipeline after the thinking visibility patch.

Changes

Cohort / File(s) Summary
Patch pipeline integration
src/patches/index.ts
Import and invoke the new writeThinkingLabel patch writer; apply it after the thinking-visibility patch and assign its result back to content.
Thinking label styling patch
src/patches/thinkingLabel.ts
New module writeThinkingLabel(oldFile) that finds the "∴ Thinking…" anchor, parses the nearby reactVar.createElement call, resolves Box/Text/React variables, constructs a nested createElement(Box, ..., createElement(Text, { italic: true, dimColor: true }, ...)) replacement, applies the edit, shows a diff, and returns transformed content.
Changelog
CHANGELOG.md
Add Unreleased note about restoring italic/dim styling for thinking blocks.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐇 I scurried through code with nimble paw,

Wrapped "Thinking…" in dim italic awe,
A Box to hold it, a Text to sigh,
Now thoughts look cozy as they pass by. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add a patch to make thinking blocks italic and dim again' accurately and clearly describes the main change - a new patch utility that styles thinking blocks with italic and dim styling.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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



📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f442ec9 and ddf03a1.

📒 Files selected for processing (1)
  • CHANGELOG.md
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/patches/thinkingLabel.ts (1)

81-81: Consider adding a guard for the identifiers array.

The non-null assertion on location.identifiers![2] is currently safe because findThinkingLabelLocation always populates the array when returning non-null. However, for defensive coding, you could add a guard:

🔧 Optional defensive check
+  if (!location.identifiers || location.identifiers.length < 3) {
+    console.error('patch: thinkingLabel: missing identifiers from location');
+    return null;
+  }
+
-  const thinkingTextVar = location.identifiers![2];
+  const thinkingTextVar = location.identifiers[2];
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 833aa88 and f442ec9.

📒 Files selected for processing (2)
  • src/patches/index.ts
  • src/patches/thinkingLabel.ts
🧰 Additional context used
🧬 Code graph analysis (2)
src/patches/index.ts (1)
src/patches/thinkingLabel.ts (1)
  • writeThinkingLabel (56-101)
src/patches/thinkingLabel.ts (1)
src/patches/index.ts (5)
  • LocationResult (73-77)
  • findBoxComponent (424-450)
  • findTextComponent (407-419)
  • getReactVar (258-314)
  • showDiff (91-129)
🔇 Additional comments (4)
src/patches/index.ts (2)

66-66: LGTM!

The import follows the established pattern used throughout the file.


609-611: LGTM!

The patch integration follows the established pattern used by other patches. The placement after writeThinkingVisibility is logical since both patches relate to thinking UI styling.

src/patches/thinkingLabel.ts (2)

18-51: LGTM!

The implementation follows codebase conventions:

  • Uses [$\w]+ pattern for identifiers as recommended in the patch-writing notes
  • Error handling with console.error is consistent with other component finders
  • The 200-char search window is a reasonable heuristic for minified code proximity

83-98: LGTM!

The replacement construction and string manipulation are correct. The showDiff call matches the expected signature from the index module.

@bl-ue bl-ue merged commit 093d0a0 into main Jan 16, 2026
2 checks passed
@bl-ue bl-ue deleted the thinking-style-patch branch January 16, 2026 14:41
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