Skip to content

Commit 7c3b5ae

Browse files
fix: hide workspaces until pat provided.
1 parent 365dc29 commit 7c3b5ae

5 files changed

Lines changed: 32 additions & 10 deletions

File tree

src/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ <h1>
165165
aria-controls="workspaces-drawer"
166166
title="Manage local workspaces"
167167
disabled
168+
hidden
168169
>
169170
<svg class="workspaces-toggle__icon" viewBox="0 0 24 24" aria-hidden="true">
170171
<path

src/modules/app-core/github-pr-context-ui.js

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,25 +111,35 @@ export const createGitHubPrContextUiController = ({
111111
workspacesToggle.disabled = false
112112
}
113113

114-
aiChatToggle?.removeAttribute('hidden')
114+
if (aiChatToggle instanceof HTMLElement) {
115+
aiChatToggle.hidden = false
116+
}
115117

116-
githubPrToggle?.removeAttribute('hidden')
118+
if (githubPrToggle instanceof HTMLElement) {
119+
githubPrToggle.hidden = false
120+
}
117121
if (!contextState.activePrContext) {
118-
workspacesToggle?.removeAttribute('hidden')
122+
if (workspacesToggle instanceof HTMLElement) {
123+
workspacesToggle.hidden = false
124+
}
119125
}
120126

121127
if (contextState.activePrContext) {
122128
githubPrContextClose?.removeAttribute('hidden')
123129
githubPrContextDisconnect?.removeAttribute('hidden')
124-
workspacesToggle?.setAttribute('hidden', '')
130+
if (workspacesToggle instanceof HTMLElement) {
131+
workspacesToggle.hidden = true
132+
}
125133
} else {
126134
githubPrContextClose?.setAttribute('hidden', '')
127135
githubPrContextDisconnect?.setAttribute('hidden', '')
128136
}
129137
return
130138
}
131139

132-
aiChatToggle?.setAttribute('hidden', '')
140+
if (aiChatToggle instanceof HTMLElement) {
141+
aiChatToggle.hidden = true
142+
}
133143
aiChatToggle?.setAttribute('aria-expanded', 'false')
134144
if (workspacesToggle instanceof HTMLButtonElement) {
135145
workspacesToggle.disabled = true
@@ -139,9 +149,13 @@ export const createGitHubPrContextUiController = ({
139149
contextState.hasSyncedActivePrEditorContent = false
140150
syncEditorPrContextIndicators(false)
141151
setGitHubPrToggleVisual('open-pr')
142-
githubPrToggle?.setAttribute('hidden', '')
152+
if (githubPrToggle instanceof HTMLElement) {
153+
githubPrToggle.hidden = true
154+
}
143155
githubPrToggle?.setAttribute('aria-expanded', 'false')
144-
workspacesToggle?.setAttribute('hidden', '')
156+
if (workspacesToggle instanceof HTMLElement) {
157+
workspacesToggle.hidden = true
158+
}
145159
workspacesToggle?.setAttribute('aria-expanded', 'false')
146160
githubPrContextClose?.setAttribute('hidden', '')
147161
githubPrContextDisconnect?.setAttribute('hidden', '')

src/modules/app-core/github-workflows.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,6 @@ const initializeGitHubWorkflows = ({
187187
onActivePrContextChange: activeContext => {
188188
prContextUi.setActivePrContext(activeContext)
189189
prContextUi.syncAiChatTokenVisibility(getTokenForVisibility())
190-
if (workspacesToggle instanceof HTMLButtonElement) {
191-
workspacesToggle.hidden = Boolean(activeContext)
192-
}
193190

194191
if (activeContext) {
195192
closeWorkspacesDrawer()

src/styles/ai-controls.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,12 @@
359359
color: color-mix(in srgb, var(--panel-text) 84%, var(--text-subtle));
360360
}
361361

362+
.diagnostics-toggle.ai-chat-toggle[hidden],
363+
.diagnostics-toggle.github-pr-toggle[hidden],
364+
.diagnostics-toggle.workspaces-toggle[hidden] {
365+
display: none;
366+
}
367+
362368
.diagnostics-toggle.workspaces-toggle:hover:not(:disabled) {
363369
color: var(--workspaces-toggle-color);
364370
}

src/styles/diagnostics.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@
9191
cursor: pointer;
9292
}
9393

94+
.diagnostics-toggle[hidden] {
95+
display: none;
96+
}
97+
9498
.diagnostics-toggle:hover {
9599
background: var(--surface-control-hover);
96100
}

0 commit comments

Comments
 (0)