Repository navigation
Add color field to sidebar_state output - #1101
Conversation
Expose workspace customColor in sidebar_state so external tools can read it without a new API endpoint.
|
@gonzaloserrano is attempting to deploy a commit to the Manaflow Team on Vercel. A member of the Team first needs to authorize it. |
|
To use Codex here, create a Codex account and connect to github. |
📝 WalkthroughWalkthroughThe code modification adds a color attribute line to the tab output in TerminalController. When constructing tab information, it now appends the tab's custom color value or "none" if not set, providing additional semantic detail about tab state. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Greptile SummaryThis PR appends a
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Tool as External Tool (e.g. Stream Deck)
participant TC as TerminalController
participant WS as Workspace (Tab)
participant TM as WorkspaceTabColorSettings
Tool->>TC: sidebar_state [tab-id]
TC->>WS: resolveTabForReport(args)
WS-->>TC: tab
TC->>WS: tab.id (UUID)
WS-->>TC: tab.id.uuidString
TC->>WS: tab.customColor
Note over WS,TM: customColor is stored as normalizedHex (#RRGGBB)<br/>set only via setCustomColor() → normalizedHex()
WS-->>TC: "#C0392B" or nil
TC->>TC: customColor ?? "none"
TC-->>Tool: "tab=...\ncolor=#C0392B\ncwd=...\n..."
Last reviewed commit: 3a3a2da |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
Sources/TerminalController.swift (1)
13629-13629: Add regression coverage for the newsidebar_statefield.Line 13629 changes a machine-consumed output contract. Please lock down both
color=<value>andcolor=nonein tests so external tooling doesn’t regress silently.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Sources/TerminalController.swift` at line 13629, Update tests that parse the machine-consumed output from TerminalController so they assert the new sidebar_state field and explicitly lock down both color=none and color=<value> cases produced by lines.append("color=\\(tab.customColor ?? \"none\")"); add at least two assertions (one where tab.customColor is nil expecting "color=none" and one where it is set expecting the exact "color=<value>") in the tests that exercise the code path that builds `lines` (reference `lines`, `tab.customColor`, and the `TerminalController` output generation) to prevent silent regressions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@Sources/TerminalController.swift`:
- Line 13629: Update tests that parse the machine-consumed output from
TerminalController so they assert the new sidebar_state field and explicitly
lock down both color=none and color=<value> cases produced by
lines.append("color=\\(tab.customColor ?? \"none\")"); add at least two
assertions (one where tab.customColor is nil expecting "color=none" and one
where it is set expecting the exact "color=<value>") in the tests that exercise
the code path that builds `lines` (reference `lines`, `tab.customColor`, and the
`TerminalController` output generation) to prevent silent regressions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 00c4b1f8-2fb6-489a-a7c2-25cd18073cbd
📒 Files selected for processing (1)
Sources/TerminalController.swift
|
streamdeck-cmux is super cool! |
…tate-color Add color field to sidebar_state output
Summary
Expose workspace customColor in sidebar_state so external tools can read it without a new API endpoint.
I'm integrating cmux with Elgato Stream Deck https://github.com/gonzaloserrano/streamdeck-cmux and I'd like to reflect workspace colors in the deck button's background color.
Testing
I did not.
Demo Video
For UI or behavior changes, include a short demo video (GitHub upload, Loom, or other direct link).
Review Trigger (Copy/Paste as PR comment)
Checklist
Summary by cubic
Expose each tab’s workspace custom color in
sidebar_stateascolor=<value>so external tools can read it without a new API. When unset, the value isnone.Written for commit 3a3a2da. Summary will update on new commits.