Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.
TypeScript adhdagent-orchestrationai-agentscanvasclaude-codecodexcoding-agentsdeveloper-toolselectrongeminilinuxmacosmultiplexeropencodeparallel-agentsterminalterminal-emulatorterminal-multiplexertmuxworkspace-manager
fix(github): Settings re-reads status after a label edit; a refused move points at the approval
review154c3a0593cb
diff --git a/src/renderer/components/kanban/KanbanView.tsx b/src/renderer/components/kanban/KanbanView.tsxindex 6cf2279a7..1f0781f51 100644--- a/src/renderer/components/kanban/KanbanView.tsx+++ b/src/renderer/components/kanban/KanbanView.tsx@@ -34,7 +34,7 @@ import {githubMoveIntent,type GitHubMoveConfirmation} from '../../lib/githubIssueMove'-import { githubThrottleSentence } from '../../lib/githubSyncStatus'+import { GITHUB_MAPPING_NOT_APPROVED, githubThrottleSentence } from '../../lib/githubSyncStatus'/** One session node shown as a board card — derived LIVE from the canvas nodes; the board* itself stores only column assignments. */@@ -584,7 +584,7 @@ export const KanbanView = memo(function KanbanView({{board.github && githubReadOnly && (<span className="kanban-github-status kanban-github-status--error">{githubMappingNotApproved- ? 'The column labels changed. Approve them in Settings → GitHub Issues to move issues again.'+ ? GITHUB_MAPPING_NOT_APPROVED: 'GitHub issues are read only until configuration and refresh are complete.'}</span>)}diff --git a/src/renderer/components/settings/sections/GitHubIssuesSection.test.tsx b/src/renderer/components/settings/sections/GitHubIssuesSection.test.tsxindex 0aab6e6ab..15a515143 100644--- a/src/renderer/components/settings/sections/GitHubIssuesSection.test.tsx+++ b/src/renderer/components/settings/sections/GitHubIssuesSection.test.tsx@@ -6,7 +6,8 @@ import type { GitHubAuthStatus, GitHubControlView } from '@shared/github-issues'import { useProjects } from '../../../state/projects'import { registerWorkspaceDirty } from '../../../state/workspaceDirty'import { SettingsSearchContext } from '../context'-import { GitHubIssuesSection } from './GitHubIssuesSection'+import { GitHubIssuesSection, STATUS_AFTER_EDIT_MS } from './GitHubIssuesSection'+import { SAVE_DEBOUNCE_MS } from '../../../lib/savePersistence';(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true@@ -178,6 +179,28 @@ describe('GitHubIssuesSection', () => {expect(approve).toHaveBeenCalledWith({ projectId: 'p1', repository: 'owner/repo', expectedRevision: 0 })})+ it('re-reads the status once a label edit has had time to save, instead of keeping "Ready as"', async () => {+ stub(viewWith({}, true))+ await mount()+ const before = status.mock.calls.length+ vi.useFakeTimers()+ try {+ const input = host.querySelector<HTMLInputElement>('#github-label-todo')!+ await act(async () => {+ const setter = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value')!.set!+ setter.call(input, 'workflow:ready')+ input.dispatchEvent(new Event('input', { bubbles: true }))+ })+ // Not before the edit can have reached the project file the host reads.+ await act(async () => { vi.advanceTimersByTime(SAVE_DEBOUNCE_MS) })+ expect(status.mock.calls.length).toBe(before)+ await act(async () => { vi.advanceTimersByTime(STATUS_AFTER_EDIT_MS - SAVE_DEBOUNCE_MS) })+ expect(status.mock.calls.length).toBeGreaterThan(before)+ } finally {+ vi.useRealTimers()+ }+ })+it('clears the write-only token field after Save and never renders the stored token', async () => {await mount()const input = host.querySelector<HTMLInputElement>('#github-personal-access-token')!diff --git a/src/renderer/components/settings/sections/GitHubIssuesSection.tsx b/src/renderer/components/settings/sections/GitHubIssuesSection.tsxindex 483b22046..4cc2f5628 100644--- a/src/renderer/components/settings/sections/GitHubIssuesSection.tsx+++ b/src/renderer/components/settings/sections/GitHubIssuesSection.tsx@@ -1,4 +1,4 @@-import { useEffect, useMemo, useState } from 'react'+import { useEffect, useMemo, useRef, useState } from 'react'import type {GitHubAuthProvider,GitHubAuthStatus,@@ -7,6 +7,7 @@ import type {} from '@shared/github-issues'import { useProjects } from '../../../state/projects'import { markWorkspaceDirty } from '../../../state/workspaceDirty'+import { SAVE_DEBOUNCE_MS } from '../../../lib/savePersistence'import { SettingsSection } from '../SettingsSection'import { SearchableRow } from '../SearchableRow'import { useSettingsSearch } from '../context'@@ -47,6 +48,12 @@ const ROWS = {}const ENTRIES = Object.values(ROWS)+/** The host reads the GitHub config from the project FILE, which a local edit reaches only through+ * the debounced autosave — so a status read right after an edit would describe the old mapping+ * (e.g. keep saying "Ready as …" for labels this machine has not approved). Re-read once, a margin+ * after that save can have landed. */+export const STATUS_AFTER_EDIT_MS = SAVE_DEBOUNCE_MS + 700+type Confirmation = 'labels' | 'cache' | 'revoke' | nulltype NoticeRow = 'repository' | 'authentication' | 'data'@@ -149,6 +156,28 @@ export function GitHubIssuesSection({ isActive }: { isActive: boolean }): React.setRepositoryDraft(githubConfig?.repository ?? '')}, [projectId, githubConfig?.repository])+ // A config edit changes what the host will answer, but only once it is on disk: re-read the status+ // after the save can have landed (see STATUS_AFTER_EDIT_MS). The first render is not an edit.+ const configKey = JSON.stringify(githubConfig ?? null)+ const statusConfigKey = useRef(configKey)+ useEffect(() => {+ if (!isActive || !projectId || project?.remote || statusConfigKey.current === configKey) return+ statusConfigKey.current = configKey+ let live = true+ const timer = setTimeout(() => {+ void (async () => {+ try {+ const next = await window.nodeTerminal.githubControl.status(projectId)+ if (!live) return+ setView(next)+ const block = await authBlockFor(next)+ if (live) setAuth(block)+ } catch { /* the last status stays; the next action re-reads it */ }+ })()+ }, STATUS_AFTER_EDIT_MS)+ return () => { live = false; clearTimeout(timer) }+ }, [configKey, isActive, projectId, project?.remote])+/** The host reads this project from DISK (`workspaceStore.githubProject`), so an edit that stays* in the renderer store is invisible to approve/refresh — `resolveProject` sees no `github`* block and throws `invalid-configuration`. `markWorkspaceDirty` is the seam every otherdiff --git a/src/renderer/lib/githubSyncStatus.ts b/src/renderer/lib/githubSyncStatus.tsindex 9fa7804a9..10c05ef62 100644--- a/src/renderer/lib/githubSyncStatus.ts+++ b/src/renderer/lib/githubSyncStatus.ts@@ -38,3 +38,8 @@ export function githubUnreachableSentence(}return 'GitHub could not be reached to check the sign-in.'}++/** Why the board will not write: this machine has not approved the column mapping now in the+ * project file. Shared by the board header and a refused move, so both point at the same fix. */+export const GITHUB_MAPPING_NOT_APPROVED =+ 'The column labels changed. Approve them in Settings → GitHub Issues to move issues again.'diff --git a/src/renderer/state/githubIssues.test.ts b/src/renderer/state/githubIssues.test.tsindex 44dfdf172..1cdd85e01 100644--- a/src/renderer/state/githubIssues.test.ts+++ b/src/renderer/state/githubIssues.test.ts@@ -179,6 +179,22 @@ describe('GitHub issue renderer state', () => {disconnect()})+ it('points a move refused for an unapproved mapping at the approval, not at a refresh', async () => {+ const client = api()+ vi.mocked(client.query).mockImplementation(async (request) => ({+ ...page(request.columnId === 'todo' ? 2 : 3, request.columnId),+ readOnly: true,+ mappingNotApproved: true as const+ }))+ vi.mocked(client.moveIssue).mockResolvedValue({ status: 'read-only' })+ const disconnect = await useGitHubIssues.getState().connect(client, 'p1', ['todo'])+ await useGitHubIssues.getState().move(client, 'p1', 2, 'done', '2026-08-09T00:00:00Z')+ const said = useGitHubIssues.getState().projects.p1.issueStatus[2]+ expect(said).toContain('Approve them in Settings')+ expect(said).not.toContain('refresh')+ disconnect()+ })+it('catches a failed move so fire-and-forget UI calls do not reject', async () => {const client = api()const disconnect = await useGitHubIssues.getState().connect(client, 'p1', ['todo'])diff --git a/src/renderer/state/githubIssues.ts b/src/renderer/state/githubIssues.tsindex 3cf43d310..faab216c8 100644--- a/src/renderer/state/githubIssues.ts+++ b/src/renderer/state/githubIssues.ts@@ -6,6 +6,7 @@ import type {GitHubIssuesApi,GitHubMutationResult} from '@shared/github-issues'+import { GITHUB_MAPPING_NOT_APPROVED } from '../lib/githubSyncStatus'export interface GitHubProjectPages {pages: Record<string, GitHubIssuePage>@@ -44,6 +45,11 @@ interface GitHubIssuesState {const keyFor = (columnId: string | null): string => columnId ?? 'ungrouped'+/** The pages say the board is read only because the column mapping is not approved here. */+function mappingNotApproved(project: GitHubProjectPages | undefined): boolean {+ return Object.values(project?.pages ?? {}).some((page) => page.mappingNotApproved)+}+/** Pages every column for one kind. Both kinds are served from the one cached snapshot in core,* so the second pass is a read of data already fetched, not a second refresh. */async function pageColumns(@@ -308,7 +314,9 @@ export const useGitHubIssues = create<GitHubIssuesState>((set, get) => ({: result.status === 'stale'? 'Changed on GitHub. Review the latest issue and retry.': result.status === 'read-only'- ? 'This repository is read only until a complete refresh succeeds.'+ ? mappingNotApproved(get().projects[projectId])+ ? GITHUB_MAPPING_NOT_APPROVED+ : 'This repository is read only until a complete refresh succeeds.': result.status === 'invalid-target'? 'This issue or destination is no longer available.': result.status === 'configuration-changed'