Skip to content

feat(tui): make carbon the default decode UI#3

Merged
CreatorGhost merged 2 commits into
devfrom
carbon-ui
Jul 11, 2026
Merged

feat(tui): make carbon the default decode UI#3
CreatorGhost merged 2 commits into
devfrom
carbon-ui

Conversation

@CreatorGhost

@CreatorGhost CreatorGhost commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Summary

Makes the Carbon design the default decode identity — true-black background with programmer green (#00e676), applied as both a theme and structural UI changes. This is decode's out-of-the-box look; it cannot be hijacked by inherited opencode configs.

Theme

  • New carbon.json theme asset (54 keys, dark + light) registered and set as DEFAULT_THEME
  • config.theme from inherited opencode configs is ignored; explicit /theme choices persist under a new decode_theme KV key (stale legacy state ignored)
  • All fallback paths resolve to carbon

Structural UI

  • Wordmark: new 3-row solid block DECODE art (white DE + green CODE), single source in src/logo.ts shared by home splash and exit epilogue
  • Home: left-aligned layout, green rule + tagline + directory line, full-width prompt field
  • Session: top strip with brand │ title · session id and live token budget
  • Prompt: green caret prefix ($ in shell mode), hairline full border, right-docked agent badge cell (agent-only on home)
  • Sidebar: CONTEXT / MODIFIED FILES / TODOS / MCP / LSP headers with right-aligned green stats, k/v rows, 24-cell context meter bar
  • Tool blocks: visible hairline border

Testing

  • bun typecheck clean (packages/tui)
  • bun test 191 pass / 0 fail
  • oxlint: 0 errors
  • Manual: home, session, exit epilogue verified in terminal

Summary by CodeRabbit

  • New Features

    • Added the Carbon theme and made it the default terminal theme.
    • Added session token usage, context limits, and cost details to the session header.
    • Added a visual context usage bar and clearer sidebar status counts.
    • Added completed/total todo counts and modified-file counts.
    • Updated the home layout for full-width prompts and improved spacing.
  • Style

    • Refreshed branding, logo artwork, sidebar labels, plugin indicators, borders, and prompt styling.

- Add carbon theme (true black + programmer green) and set as default
- Ignore inherited opencode config themes; /theme choice persists under decode_theme
- New DECODE block wordmark, single source for home and exit epilogue
- Session top strip with brand, title, and token budget
- Prompt: green caret prefix, hairline full border, right-docked agent badge
- Sidebar: CONTEXT/MODIFIED FILES/TODOS/MCP/LSP headers with green stats and context meter
- Left-aligned home with full-width prompt field
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@CreatorGhost, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e788d403-10ac-40ea-a0a0-0a6132292d70

📥 Commits

Reviewing files that changed from the base of the PR and between 7f79572 and 8118baf.

📒 Files selected for processing (4)
  • packages/tui/src/component/prompt/index.tsx
  • packages/tui/src/context/theme.tsx
  • packages/tui/src/feature-plugins/sidebar/context.tsx
  • packages/tui/src/routes/session/index.tsx
📝 Walkthrough

Walkthrough

The TUI adds Carbon theme support, changes theme persistence, refreshes logo and branding output, restructures prompt and session layouts, adds session budget information, and updates sidebar context, file, LSP, MCP, and todo summaries.

Changes

TUI refresh

Layer / File(s) Summary
Carbon theme and persistence
packages/tui/src/theme/assets/carbon.json, packages/tui/src/theme/index.ts, packages/tui/src/context/theme.tsx
Adds the Carbon theme and uses carbon plus the decode_theme KV entry for theme initialization, fallback, resolution, and persistence.
Branding and wordmark rendering
packages/tui/src/logo.ts, packages/tui/src/component/logo.tsx, packages/tui/src/util/presentation.ts, packages/tui/src/feature-plugins/sidebar/footer.tsx
Replaces logo artwork and simplifies wordmark rendering, while adding logo directory messaging and updating sidebar branding copy.
Route, prompt, and session layout
packages/tui/src/routes/home.tsx, packages/tui/src/component/prompt/index.tsx, packages/tui/src/routes/session/index.tsx
Updates prompt sizing and alignment, applies a full prompt border layout, and adds session token-budget and cost information to a new header.
Sidebar status summaries
packages/tui/src/feature-plugins/sidebar/context.tsx, packages/tui/src/feature-plugins/sidebar/files.tsx, packages/tui/src/feature-plugins/sidebar/lsp.tsx, packages/tui/src/feature-plugins/sidebar/mcp.tsx, packages/tui/src/feature-plugins/sidebar/todo.tsx
Adds context progress bars and revises sidebar headers to show counts, completion state, and connection statuses.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Session
  participant AssistantMessage
  participant ProviderModelData
  participant SessionHeader
  Session->>AssistantMessage: read latest assistant output usage
  Session->>ProviderModelData: resolve model context limit
  Session->>SessionHeader: render tokens, limit, and cost
Loading
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the summary and testing, but it omits required template sections like issue, change type, screenshots, and checklist. Add the missing template sections: issue/Closes #, type of change, screenshots/recordings, and checklist items; keep the summary and testing.
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 (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: making Carbon the default TUI theme/UI.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch carbon-ui

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.

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

Actionable comments posted: 2

🧹 Nitpick comments (3)
packages/tui/src/context/theme.tsx (1)

258-264: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Middle fallback in values() memo appears redundant.

store.active is already initialized from kv.get("decode_theme", DEFAULT_THEME) (line 124–125). When store.themes[store.active] is falsy, the middle fallback reads kv.get("decode_theme") — which returns the same value as store.active — so store.themes[saved] will also be falsy. The successful path is always either the first check or the final DEFAULT_THEME fallback.

This is safe defensive code, but consider simplifying to reduce cognitive overhead.

♻️ Optional simplification
     const values = createMemo(() => {
       const active = store.themes[store.active]
       if (active) return resolveTheme(active, store.mode)
 
-      const saved = kv.get("decode_theme")
-      if (typeof saved === "string") {
-        const theme = store.themes[saved]
-        if (theme) return resolveTheme(theme, store.mode)
-      }
-
       return resolveTheme(store.themes[DEFAULT_THEME], store.mode)
     })
🤖 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 `@packages/tui/src/context/theme.tsx` around lines 258 - 264, Remove the
redundant kv.get("decode_theme") lookup and its associated fallback branch from
the values() memo, leaving the existing store.active theme resolution and final
DEFAULT_THEME fallback unchanged.
packages/tui/src/feature-plugins/sidebar/context.tsx (2)

37-40: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Move BAR_WIDTH above its usage for readability.

BAR_WIDTH is referenced in the bar memo (Line 38) but declared after the View function (Line 64). It's safe at runtime since View only executes after module evaluation completes, but placing the constant near the top of the file (or above View) would make the dependency clearer.

♻️ Proposed fix
+const BAR_WIDTH = 24
+
 function View(props: { api: TuiPluginApi; session_id: string }) {
   ...
 }
-
-const BAR_WIDTH = 24

Also applies to: 64-65

🤖 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 `@packages/tui/src/feature-plugins/sidebar/context.tsx` around lines 37 - 40,
Move the BAR_WIDTH constant declaration above the bar createMemo and before the
View function, preserving its existing value and all current progress-bar
behavior.

42-61: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Duplicated sidebar header/toggle pattern across five files.

The header box (flex row, justifyContent="space-between", arrow toggle gated on list().length > 2, onMouseDown toggling open) is repeated nearly verbatim in this file and in files.tsx, lsp.tsx, mcp.tsx, and todo.tsx. Consider extracting a shared SidebarSectionHeader component (label, count/status slot, toggle behavior) to avoid five copies drifting out of sync.

🤖 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 `@packages/tui/src/feature-plugins/sidebar/context.tsx` around lines 42 - 61,
The sidebar section header and toggle behavior is duplicated across the context
sidebar and the corresponding files, lsp, mcp, and todo components. Extract a
shared SidebarSectionHeader component that accepts the section label,
count/status content, list-based toggle visibility, open state, and toggle
handler, then replace each local header implementation with it while preserving
existing styling and behavior.
🤖 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.

Inline comments:
In `@packages/tui/src/component/prompt/index.tsx`:
- Around line 1412-1430: Use the disabled-aware cursor color consistently in the
prompt input component: update the effect near the existing cursor-color
assignment and the deferred callback inside the textarea ref to assign
props.disabled ? theme.backgroundElement : theme.primary. Keep the declarative
cursorColor prop aligned with this same value.

In `@packages/tui/src/routes/session/index.tsx`:
- Around line 1180-1210: Update the session header layout around the title
<text> and budget <Show> block so the left segment can shrink within the
available width and the title truncation adapts to terminal width instead of
always using 60 characters. Preserve the non-shrinking budget block and ensure
the session ID and budget remain readable without overlap on narrow terminals.

---

Nitpick comments:
In `@packages/tui/src/context/theme.tsx`:
- Around line 258-264: Remove the redundant kv.get("decode_theme") lookup and
its associated fallback branch from the values() memo, leaving the existing
store.active theme resolution and final DEFAULT_THEME fallback unchanged.

In `@packages/tui/src/feature-plugins/sidebar/context.tsx`:
- Around line 37-40: Move the BAR_WIDTH constant declaration above the bar
createMemo and before the View function, preserving its existing value and all
current progress-bar behavior.
- Around line 42-61: The sidebar section header and toggle behavior is
duplicated across the context sidebar and the corresponding files, lsp, mcp, and
todo components. Extract a shared SidebarSectionHeader component that accepts
the section label, count/status content, list-based toggle visibility, open
state, and toggle handler, then replace each local header implementation with it
while preserving existing styling and behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 764202b9-6af2-442e-bdb3-e332b8c3c2c0

📥 Commits

Reviewing files that changed from the base of the PR and between ca47e39 and 7f79572.

📒 Files selected for processing (15)
  • packages/tui/src/component/logo.tsx
  • packages/tui/src/component/prompt/index.tsx
  • packages/tui/src/context/theme.tsx
  • packages/tui/src/feature-plugins/sidebar/context.tsx
  • packages/tui/src/feature-plugins/sidebar/files.tsx
  • packages/tui/src/feature-plugins/sidebar/footer.tsx
  • packages/tui/src/feature-plugins/sidebar/lsp.tsx
  • packages/tui/src/feature-plugins/sidebar/mcp.tsx
  • packages/tui/src/feature-plugins/sidebar/todo.tsx
  • packages/tui/src/logo.ts
  • packages/tui/src/routes/home.tsx
  • packages/tui/src/routes/session/index.tsx
  • packages/tui/src/theme/assets/carbon.json
  • packages/tui/src/theme/index.ts
  • packages/tui/src/util/presentation.ts

Comment thread packages/tui/src/component/prompt/index.tsx
Comment thread packages/tui/src/routes/session/index.tsx
- Disabled-aware cursor color in all three assignment paths
- Width-aware session strip title truncation with shrinkable left segment
- Remove redundant decode_theme fallback in values() memo
- Move BAR_WIDTH above its usage
@CreatorGhost
CreatorGhost merged commit 4edde72 into dev Jul 11, 2026
4 of 7 checks passed
@CreatorGhost
CreatorGhost deleted the carbon-ui branch July 11, 2026 18:07
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