Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(web): allow customizing topbar header controls visibility via context menu #7204

Closedkbrianps(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/7204/headopened View on GitHub

Showing 4 changed files with 162 additions and 28 deletions (loading 1).

x
0 of 4 viewed, 4 left
33 additions and 1 deletionapps/web/src/components/chat/ChatHeader.test.tsModified
View file
@@ -1,7 +1,11 @@
import { EnvironmentId } from "@t3tools/contracts";
import { describe, expect, it } from "vite-plus/test";
​
-import { resolveRenameCommit, shouldShowOpenInPicker } from "./ChatHeader";
+import {
+ buildHeaderControlsContextMenuItems,
+ resolveRenameCommit,
+ shouldShowOpenInPicker,
+} from "./ChatHeader";
​
describe("shouldShowOpenInPicker", () => {
const primaryEnvironmentId = EnvironmentId.make("environment-primary");
@@ -82,3 +86,31 @@
});
});
});
+​
+describe("buildHeaderControlsContextMenuItems", () => {
+ it("formats checked state when all controls are visible", () => {
+ const items = buildHeaderControlsContextMenuItems({
+ scripts: true,
+ openIn: true,
+ git: true,
+ });
+ expect(items).toEqual([
+ { id: "scripts", label: "✓\u00A0Action scripts" },
+ { id: "openIn", label: "✓\u00A0Open in editor" },
+ { id: "git", label: "✓\u00A0Git source control" },
+ ]);