Skip to content

Commit 0aec10c

Browse files
committed
fix: sidebar shows OpenCode instead of Altimate Code after upstream merge
- Replace `<b>Open</b><b>Code</b>` with `<b>Altimate</b><b> Code</b>` in sidebar footer - Add `altimate_change` markers to protect branding block from future upstream merges - Add TUI branding guard tests to `upstream-merge-guard.test.ts` Closes #167
1 parent 581ef2c commit 0aec10c

2 files changed

Lines changed: 30 additions & 9 deletions

File tree

packages/opencode/src/cli/cmd/tui/routes/session/sidebar.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,13 +307,15 @@ export function Sidebar(props: { sessionID: string; overlay?: boolean }) {
307307
<span style={{ fg: theme.textMuted }}>{directory().split("/").slice(0, -1).join("/")}/</span>
308308
<span style={{ fg: theme.text }}>{directory().split("/").at(-1)}</span>
309309
</text>
310+
{/* altimate_change start — sidebar branding */}
310311
<text fg={theme.textMuted}>
311-
<span style={{ fg: theme.success }}></span> <b>Open</b>
312+
<span style={{ fg: theme.success }}></span> <b>Altimate</b>
312313
<span style={{ fg: theme.text }}>
313-
<b>Code</b>
314+
<b> Code</b>
314315
</span>{" "}
315316
<span>{Installation.VERSION}</span>
316317
</text>
318+
{/* altimate_change end */}
317319
</box>
318320
</box>
319321
</Show>

packages/opencode/test/branding/upstream-merge-guard.test.ts

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ describe("Installation script branding", () => {
3838
// Should not contain the upstream npm package name in install commands
3939
// (note: @opencode-ai/ as internal scope is allowed, but `opencode-ai@` as
4040
// an npm install target is not)
41-
const installLines = installSrc.split("\n").filter(
42-
(line) =>
43-
(line.includes("npm") || line.includes("pnpm") || line.includes("bun")) &&
44-
line.includes("install"),
45-
)
41+
const installLines = installSrc
42+
.split("\n")
43+
.filter(
44+
(line) => (line.includes("npm") || line.includes("pnpm") || line.includes("bun")) && line.includes("install"),
45+
)
4646
for (const line of installLines) {
4747
expect(line).not.toMatch(/["'`]opencode-ai["'`@]/)
4848
}
@@ -206,13 +206,13 @@ describe("OAuth/MCP branding", () => {
206206
const oauthProviderPath = join(srcDir, "mcp", "oauth-provider.ts")
207207
const oauthCallbackPath = join(srcDir, "mcp", "oauth-callback.ts")
208208

209-
test("oauth-provider.ts has client_name: \"Altimate Code\" not \"OpenCode\"", () => {
209+
test('oauth-provider.ts has client_name: "Altimate Code" not "OpenCode"', () => {
210210
const content = readText(oauthProviderPath)
211211
expect(content).toContain('client_name: "Altimate Code"')
212212
expect(content).not.toMatch(/client_name:\s*"OpenCode"/)
213213
})
214214

215-
test("oauth-callback.ts HTML titles contain \"Altimate Code\" not \"OpenCode\"", () => {
215+
test('oauth-callback.ts HTML titles contain "Altimate Code" not "OpenCode"', () => {
216216
const content = readText(oauthCallbackPath)
217217
// All <title> tags should reference Altimate Code
218218
const titleMatches = content.match(/<title>[^<]+<\/title>/g) ?? []
@@ -300,6 +300,25 @@ describe("No opencode.ai domain leaks in src/", () => {
300300
})
301301
})
302302

303+
// ---------------------------------------------------------------------------
304+
// 5b. TUI Branding (sidebar, headers, etc.)
305+
// ---------------------------------------------------------------------------
306+
describe("TUI branding", () => {
307+
const sidebarPath = join(srcDir, "cli", "cmd", "tui", "routes", "session", "sidebar.tsx")
308+
const sidebarContent = readText(sidebarPath)
309+
310+
test("sidebar shows 'Altimate' not 'Open' as branded name", () => {
311+
// The sidebar footer must say "Altimate Code", not "OpenCode"
312+
expect(sidebarContent).toContain("<b>Altimate</b>")
313+
expect(sidebarContent).not.toMatch(/<b>Open<\/b>\s*\n\s*<span[^>]*>\s*<b>Code<\/b>/)
314+
})
315+
316+
test("sidebar has altimate_change marker to protect branding", () => {
317+
expect(sidebarContent).toContain("altimate_change start")
318+
expect(sidebarContent).toContain("altimate_change end")
319+
})
320+
})
321+
303322
// ---------------------------------------------------------------------------
304323
// 6. Build & Package Branding
305324
// ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)