Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 6 additions & 15 deletions console/web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import { Browser } from '@/pages/Browser'
import { Configuration } from '@/pages/Configuration'
import { ExtPage } from '@/pages/Ext'
import { Github } from '@/pages/Github'
import { Memory } from '@/pages/Memory'
import { TracesV2 } from '@/pages/TracesV2'
import { Workers } from '@/pages/Workers'
import { Worktrees } from '@/pages/Worktrees'
Expand Down Expand Up @@ -114,8 +113,6 @@ export function App() {
<Worktrees />
) : view === 'browser' ? (
<Browser />
) : view === 'memory' ? (
<Memory />
) : view === 'github' ? (
<Github />
) : view === 'ext' ? (
Expand Down Expand Up @@ -158,23 +155,17 @@ function Header({
// Optional-worker entries appear only while their worker is present; a
// direct #/worktrees or #/browser hit still lands on that page's install
// notice.
const {
worktreeAvailable,
browserAvailable,
memoryAvailable,
githubAvailable,
} = useConversationsCtx()
// `memoryAvailable` stays on the context for the chat composer's bank
// selector; the memory page is now injected UI (nav entry via `extPages`),
// so it is no longer a first-party nav option here.
const { worktreeAvailable, browserAvailable, githubAvailable } =
useConversationsCtx()
// Injected pages: the runtime analogue of worker-presence gating —
// presence is the script being loaded, which already tracks worker
// connectedness via trigger GC.
const extPages = useExtPages()
const viewOptions: { value: string; label: string }[] = [
...buildViewOptions(
worktreeAvailable,
browserAvailable,
memoryAvailable,
githubAvailable,
),
...buildViewOptions(worktreeAvailable, browserAvailable, githubAvailable),
...extPages.map((page) => ({
value: extNavValue(page),
label: page.title,
Expand Down
6 changes: 0 additions & 6 deletions console/web/src/hooks/use-hash-route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export type View =
| 'workers'
| 'worktrees'
| 'browser'
| 'memory'
| 'github'
| 'ext'

Expand Down Expand Up @@ -99,9 +98,6 @@ function routeFromHash(hash: string): View | null {
if (hash === '#/worktrees') {
return 'worktrees'
}
if (hash === '#/memory') {
return 'memory'
}
if (hash === '#/github') {
return 'github'
}
Expand Down Expand Up @@ -139,8 +135,6 @@ function hashFor(view: View): string {
return '#/worktrees'
case 'browser':
return '#/browser'
case 'memory':
return '#/memory'
case 'github':
return '#/github'
case 'configuration':
Expand Down
94 changes: 0 additions & 94 deletions console/web/src/hooks/use-memory-events.ts

This file was deleted.

47 changes: 26 additions & 21 deletions console/web/src/lib/nav-options.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,43 @@ import { buildViewOptions } from './nav-options'

describe('buildViewOptions', () => {
it('hides the optional-worker entries while their workers are absent', () => {
expect(
buildViewOptions(false, false, false, false).map((o) => o.value),
).toEqual(['traces', 'workers'])
expect(buildViewOptions(false, false, false).map((o) => o.value)).toEqual([
'traces',
'workers',
])
})

it('appends the worktrees entry when the worker is present', () => {
expect(
buildViewOptions(true, false, false, false).map((o) => o.value),
).toEqual(['traces', 'workers', 'worktrees'])
expect(buildViewOptions(true, false, false).map((o) => o.value)).toEqual([
'traces',
'workers',
'worktrees',
])
})

it('appends the browser entry when the worker is present', () => {
expect(
buildViewOptions(false, true, false, false).map((o) => o.value),
).toEqual(['traces', 'workers', 'browser'])
})

it('appends the memory entry when the worker is present', () => {
expect(
buildViewOptions(false, false, true, false).map((o) => o.value),
).toEqual(['traces', 'workers', 'memory'])
expect(buildViewOptions(false, true, false).map((o) => o.value)).toEqual([
'traces',
'workers',
'browser',
])
})

it('appends the github entry when the worker is present', () => {
expect(
buildViewOptions(false, false, false, true).map((o) => o.value),
).toEqual(['traces', 'workers', 'github'])
expect(buildViewOptions(false, false, true).map((o) => o.value)).toEqual([
'traces',
'workers',
'github',
])
})

it('appends every entry when all optional workers are present', () => {
expect(
buildViewOptions(true, true, true, true).map((o) => o.value),
).toEqual(['traces', 'workers', 'worktrees', 'browser', 'memory', 'github'])
expect(buildViewOptions(true, true, true).map((o) => o.value)).toEqual([
'traces',
'workers',
'worktrees',
'browser',
'github',
])
})
})
4 changes: 0 additions & 4 deletions console/web/src/lib/nav-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import type { View } from '@/hooks/use-hash-route'
export function buildViewOptions(
worktreeAvailable: boolean,
browserAvailable: boolean,
memoryAvailable: boolean,
githubAvailable: boolean,
): { value: View; label: string }[] {
const options: { value: View; label: string }[] = [
Expand All @@ -22,9 +21,6 @@ export function buildViewOptions(
if (browserAvailable) {
options.push({ value: 'browser', label: 'browser' })
}
if (memoryAvailable) {
options.push({ value: 'memory', label: 'memory' })
}
if (githubAvailable) {
options.push({ value: 'github', label: 'github' })
}
Expand Down
Loading
Loading