Skip to content

Commit 0859f1a

Browse files
committed
fix(tui): limit transparency to canvas surfaces
1 parent 85301a9 commit 0859f1a

7 files changed

Lines changed: 223 additions & 237 deletions

File tree

‎docs/TUI.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,14 @@ and unknown environments fall back to dark. The macOS read has a 500 ms process
248248
timeout. Production does not query OSC 11 or switch themes after mount, so the
249249
first frame cannot mix palettes across transcript, prompt, borders, or overlays.
250250

251+
Set `CORBITS_TRANSPARENT_BACKGROUND=1` (also `true`, `yes`, or `on`) to let the
252+
host terminal show through the root, transcript, landing, welcome, and provider
253+
canvases. This is an explicit OpenTUI canvas opt-in, not a guess based on
254+
terminal name or truecolor reporting. The detected or selected dark/light theme
255+
still owns every foreground color, while the prompt frame and input, decision
256+
surfaces, and focused or selected rows retain that theme's opaque ground so
257+
focus and text contrast do not depend on the host background.
258+
251259
## The live task list panel
252260

253261
**Parked pending rebuild.** `formatChromeZones` (`src/tui/chrome-state.ts`)

‎src/tui/landing.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -317,23 +317,23 @@ export function createLandingAbove(
317317
flexDirection: "column",
318318
justifyContent: "flex-end",
319319
paddingLeft: LANDING_MARGIN,
320-
backgroundColor: UI.ground,
320+
backgroundColor: UI.canvasGround,
321321
});
322322
const hero = new BoxRenderable(ctx, {
323323
id: "shell-landing-hero",
324324
width: "100%",
325325
height: MARK_LARGE.rows,
326326
flexShrink: 0,
327327
flexDirection: "row",
328-
backgroundColor: UI.ground,
328+
backgroundColor: UI.canvasGround,
329329
});
330330
const markColumn = new BoxRenderable(ctx, {
331331
id: "shell-landing-mark",
332332
width: MARK_LARGE.cols,
333333
flexShrink: 0,
334334
flexDirection: "column",
335335
justifyContent: "flex-end",
336-
backgroundColor: UI.ground,
336+
backgroundColor: UI.canvasGround,
337337
});
338338
const markRows: TextRenderable[] = [];
339339
for (let row = 0; row < MARK_LARGE.rows; row++) {
@@ -380,7 +380,7 @@ function createHintBlock(ctx: CliRenderer): BoxRenderable {
380380
// empty beneath them, which reads as unfinished rather than composed.
381381
justifyContent: "center",
382382
paddingLeft: LANDING_HERO_GAP,
383-
backgroundColor: UI.ground,
383+
backgroundColor: UI.canvasGround,
384384
});
385385
LANDING_HINTS.forEach((hint, index) => {
386386
const gap = " ".repeat(
@@ -452,7 +452,7 @@ export function createLandingBelow(
452452
flexShrink: 0,
453453
flexDirection: "column",
454454
paddingLeft: LANDING_MARGIN,
455-
backgroundColor: UI.ground,
455+
backgroundColor: UI.canvasGround,
456456
});
457457
landingBelowRows(content).forEach((row, index) => {
458458
box.add(

‎src/tui/provider/surface.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export function createSurface(
119119
width: "100%",
120120
height: "100%",
121121
flexDirection: "column",
122-
backgroundColor: UI.ground,
122+
backgroundColor: UI.canvasGround,
123123
paddingTop: 1,
124124
paddingLeft: margin,
125125
paddingRight: margin,
@@ -162,7 +162,7 @@ export function createSurface(
162162
flexDirection: "column",
163163
flexShrink: 0,
164164
paddingTop: 1,
165-
backgroundColor: UI.ground,
165+
backgroundColor: UI.canvasGround,
166166
});
167167
const summarySlots = Array.from(
168168
{ length: SUMMARY_SLOTS },
@@ -181,7 +181,7 @@ export function createSurface(
181181
flexDirection: "column",
182182
flexShrink: 0,
183183
paddingTop: 1,
184-
backgroundColor: UI.ground,
184+
backgroundColor: UI.canvasGround,
185185
});
186186
const listSlots = Array.from(
187187
{ length: PROVIDER_LIST_ROWS_MAX },
@@ -225,7 +225,7 @@ export function createSurface(
225225
flexDirection: "column",
226226
flexShrink: 0,
227227
paddingTop: 1,
228-
backgroundColor: UI.ground,
228+
backgroundColor: UI.canvasGround,
229229
visible: false,
230230
});
231231
const loginSlots = Array.from(
@@ -257,7 +257,7 @@ export function createSurface(
257257
flexDirection: "column",
258258
flexShrink: 0,
259259
paddingTop: 1,
260-
backgroundColor: UI.ground,
260+
backgroundColor: UI.canvasGround,
261261
visible: config.showTelemetryNotice,
262262
});
263263
const telemetrySlots = Array.from(

‎src/tui/shell/index.ts‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export function createAppShell(
124124
width: "100%",
125125
height: "100%",
126126
flexDirection: "column",
127-
backgroundColor: UI.ground,
127+
backgroundColor: UI.canvasGround,
128128
paddingLeft: layout.sideMargin,
129129
paddingRight: layout.sideMargin,
130130
});
@@ -136,7 +136,7 @@ export function createAppShell(
136136
width: "100%",
137137
height: 1,
138138
flexShrink: 0,
139-
backgroundColor: UI.ground,
139+
backgroundColor: UI.canvasGround,
140140
});
141141

142142
// Same gutter, other end: keeps the prompt box off the terminal's last row.
@@ -145,7 +145,7 @@ export function createAppShell(
145145
width: "100%",
146146
height: 1,
147147
flexShrink: 0,
148-
backgroundColor: UI.ground,
148+
backgroundColor: UI.canvasGround,
149149
});
150150

151151
// Persistent chrome, not part of the landing composition (`landing.ts`
@@ -164,7 +164,7 @@ export function createAppShell(
164164
flexShrink: 0,
165165
flexDirection: "row",
166166
justifyContent: "flex-end",
167-
backgroundColor: UI.ground,
167+
backgroundColor: UI.canvasGround,
168168
visible: versionBadgeVisible(terminal.columns, terminal.rows),
169169
});
170170
const versionBadge = new TextRenderable(ctx, {
@@ -181,7 +181,7 @@ export function createAppShell(
181181
height: 1,
182182
flexShrink: 0,
183183
flexDirection: "column",
184-
backgroundColor: UI.ground,
184+
backgroundColor: UI.canvasGround,
185185
visible: false,
186186
});
187187

@@ -191,7 +191,7 @@ export function createAppShell(
191191
height: 1,
192192
flexShrink: 0,
193193
flexDirection: "column",
194-
backgroundColor: UI.ground,
194+
backgroundColor: UI.canvasGround,
195195
visible: false,
196196
});
197197

@@ -204,9 +204,9 @@ export function createAppShell(
204204
stickyStart: "bottom",
205205
scrollY: true,
206206
focusable: true,
207-
rootOptions: { backgroundColor: UI.ground },
208-
contentOptions: { backgroundColor: UI.ground },
209-
viewportOptions: { backgroundColor: UI.ground },
207+
rootOptions: { backgroundColor: UI.canvasGround },
208+
contentOptions: { backgroundColor: UI.canvasGround },
209+
viewportOptions: { backgroundColor: UI.canvasGround },
210210
});
211211
// The transcript scrolls with the keyboard, and the bar spent a column on
212212
// every row to say so. Position is legible from the content itself.
@@ -224,7 +224,7 @@ export function createAppShell(
224224
width: "100%",
225225
height: 0,
226226
flexShrink: 0,
227-
backgroundColor: UI.ground,
227+
backgroundColor: UI.canvasGround,
228228
});
229229
transcript.add(transcriptSpacer);
230230

@@ -260,7 +260,7 @@ export function createAppShell(
260260
height: Math.max(1, layout.heights.pending),
261261
flexShrink: 0,
262262
flexDirection: "column",
263-
backgroundColor: UI.ground,
263+
backgroundColor: UI.canvasGround,
264264
visible: layout.heights.pending > 0,
265265
});
266266

0 commit comments

Comments
 (0)