Repository navigation
fix(sources): GitHub Projects boards read from the task page's source host - #27270
Conversation
… host The Projects board, its project picker and unmatched-row edits picked their host from the Active Server setting on their own, while the Tasks header named the selected repositories' hosts. The board now takes the same row-less source host that Linear and Jira use, converted through getTaskSourceRuntimeSettings, and the header names that host in Projects mode. fetchProjectViewTable takes the source explicitly instead of reading settings. The ownership table marks the four board-level GitHub Projects reads as scope-picked.
…ts row's host The dialog took the board's live source, so a source change while it was open sent its comment and field edits to a different host than the one the row was loaded from. It now routes by the source encoded in its row's cache key, like the row field edits already do.
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🔵 Low · up to Switching board sources can temporarily show an error instead of an available cached table. This is a bounded issue to fix or explicitly accept before merging. Pre-merge checks |
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
ab4eb50b-7f02-4ba3-a86e-0d54b3857560
📒 Files selected for processing (20)
config/owner-routing-baseline.txtsrc/renderer/src/components/github-project/ProjectPicker.tsxsrc/renderer/src/components/github-project/ProjectViewToolbar.tsxsrc/renderer/src/components/github-project/ProjectViewWrapper.tsxsrc/renderer/src/components/github-project/project-picker-runtime.tssrc/renderer/src/components/github-project/useProjectPickerBrowse.tssrc/renderer/src/components/github-project/useProjectViewTable.tssrc/renderer/src/components/task-page-source-context.tsxsrc/renderer/src/components/task-page-task-source-host-availability.test.tssrc/renderer/src/components/task-page/Content.tsxsrc/renderer/src/components/task-page/SourceBar.tsxsrc/renderer/src/components/task-source-context-summary.tssrc/renderer/src/store/github/project-actions.tssrc/renderer/src/store/github/provider-request-coalescing.test.tssrc/renderer/src/store/github/slice-types.tssrc/renderer/src/store/slices/github-project-request-coordination.test.tssrc/renderer/src/store/slices/github-project-view-tables.test.tssrc/renderer/src/store/slices/github-provider-request-concurrency.test.tssrc/shared/host-operation-ownership.test.tssrc/shared/host-operation-ownership.ts
💤 Files with no reviewable changes (1)
- config/owner-routing-baseline.txt
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
| const mountedRef = useMountedRef() | ||
| const target = getActiveRuntimeTarget(settings) | ||
| const sourceScope = target.kind === 'environment' ? `runtime:${target.environmentId}` : 'local' | ||
| const sourceScope = projectViewSourceScope(sourceSettings) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Ignore fetch failures from a previous board source.
If the source changes while a fetch is pending and the new source already has a cached table, the cache-hit effect does not call doFetch. fetchRunIdRef remains unchanged. A failure from the old source can then set error, and ProjectViewBody shows that error instead of the cached table. Invalidate pending fetch results when sourceScope changes, including when the new table is cached.
ELI5
The Tasks page has a GitHub Projects view (the project board). Before this change, the board quietly loaded from whichever server the app-wide "Active Server" setting named, while the label at the top of the Tasks page talked about the hosts of your selected repositories. So the label could say "This computer" while the board was actually coming from a remote server. Now the board loads from the same source host that Linear and Jira on the Tasks page already use, and the label names that host.
What Changed
<host>is the host the board really loads from. It shows when that host is disconnected. Which host is used doesn't change: it is the same host Linear and Jira on the Tasks page use.ProjectViewWrappernow receives the Tasks page's row-less source host (accountBackedTaskSourceHostId, which Linear and Jira already use). It converts that host with the existinggetTaskSourceRuntimeSettingsselector and passes the result to the table hook, the project picker, the slug dialog and the row cells. None of them reads settings to pick a host anymore.fetchProjectViewTabletakes the source as an explicit argument instead of readingget().settings. Row edits already route by the source written into the cache key, so they follow automatically.listProjectViewsForRuntimefromuseProjectViewTable. The table hook now reuses the one the picker uses.HOST_OPERATION_OWNERSHIP) gets a short per-method list. The four board-level reads (github.project.viewTable,listViews,listAccessible,resolveRef) arescope-picked. Row edits staycredential, because they go to the matched repository's owner first.Why
This follows the decision that work with no source row (GitHub Projects boards, Tasks-page sources, Jira) uses the task-source selector with a visible host label, and never picks a host on its own from focus. Two other approaches were considered:
With one host value for all three, a future Tasks-page picker only has to change that one value.
Adapted from the design (known limit): the shared host for row-less sources still comes from the "Active Server" / default-host setting, as it does on main. It is read again whenever the setting changes, the same way the Settings host picker uses that setting as its default. Making it a stable choice that ignores later setting changes needs Linear and Jira connection status per host, because the store tracks them only for that setting's host today. Without that, Linear and Jira could show a connection state from one host and data from another. That follow-up belongs with the Tasks-page picker. Writes are safe in the meantime: row edits and the unmatched-row dialog stay on the host their row was loaded from, and rows from a tracked repository go to that repository's owner.
Jira and Linear on the Tasks page already go through their task-source contexts, so this PR doesn't change them.
Linked Issue
None. This is part of the host-ownership routing stack.
Visual Proof
N/A. The only visible change is the text of the existing header label in Projects mode, which is covered by unit tests. The machine is load-capped, so the app wasn't launched.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
host-operation-ownership.test.ts: the new board-method case fails onorigin/main(expected 'credential' to be 'scope-picked') and passes here.github-project-view-tables.test.ts: the board loads from the source it is given, not from the focused server, and runtime and local caches stay separate when focus doesn't change.task-page-task-source-host-availability.test.ts: the Projects header names the board host, a missing task-source capability doesn't mark it unavailable, and a disconnected host does.Ran:
pnpm tc:web, focusedpnpm test(github-project, task-page and store suites; 62 files),oxlint,pnpm run check:code-quality:changed,pnpm check:owner-routing-ratchet.Review
Agent skill upstream boundary
Notes
No wire change: the runtime RPC methods and params are the same, and only the renderer decides where to send them. SSH: the row-less host is "this computer" or a saved server, never a direct SSH host, which is the same as before. Folder workspaces and Windows are unaffected.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)