Repository navigation
fix(git-panel): show no-repository state - #10794
Conversation
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify a git-less or sandbox-refused host acceptably shows the persistent 503 notice in Files→Changed, since missing-executable was quietly "not a repo" before. [DESIGN-REVIEWED] 51d5fd0 |
Opus 4.8 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
UX Review (Fable 5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS Failed status with an empty commit list renders unexplained blank space while the notice references history that isn't on screen — reader: "no idea". Watch
Suggestions
[UX-REVIEWED] 51d5fd0 |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify the ChatPage footer badge on the new 503: the spec now asserts it "degrades silently", but no test in this diff exercises that consumer. Not justified as shipped
What this change shipsInventory (10 items) — 9 justifiedIntent: FIX (issue #10775) — stop the Git panel presenting a Git failure as "not a repository" or as stale/clean data.
Consumer counts run: [FIRST-PRINCIPLES-REVIEWED] 51d5fd0 |
GPT 5.6 Review — ✅ no blocking findings (all downgraded on adjudication)GPT 5.6 flagged blocking issues on This comment is updated in place on each push. Review detailsBLOCKING -- website/src/pages/chat/FileBrowserRail.tsx:519 -- Content mode suppresses the Git status failure Adjudication (Opus 4.8) — is blocking on each finding proportionate?I've verified the code. The finding is real at the code level: with But the cited anchor Harm weighing:
[ADJUDICATION] 51d5fd0 total=1 uphold=0 downgrade=1 False positive or not applicable? A repository writer can comment: |
a37a10c to
667a89b
Compare
667a89b to
6425f74
Compare
80ba052 to
a2e0a79
Compare
|
|
|
|
|
a2e0a79 to
dd6566d
Compare
dd6566d to
d7d4840
Compare
1f5687e to
7ac713f
Compare
7ac713f to
92c2b8d
Compare
92c2b8d to
016d2ba
Compare
016d2ba to
1fac5ed
Compare
|
|
|
|
|
CI note: |
bolichen97
left a comment
There was a problem hiding this comment.
Approved after verification: PR Readiness success on this head, no active change requests or unresolved threads, mergeable against current main.
Problem / Motivation
The Git panel could confuse “not a repository” with “Git failed.” A failed refresh could keep stale branch, sync, clean, or changed-file data beside an error.
Why it matters
These states need different fixes. Wrong copy sends the user to choose another folder when the real problem is an unavailable or damaged repository.
What changed (motivation → approach → change)
The status route lets sandboxed Git decide whether the project belongs to a repository. Only Git’s explicit
not a git repositoryverdict returns200 {"repo": false, "files": []}. A confirmed repository with a corrupt HEAD, unreadable root, or failed status command returns503 git_status_unavailable. The post-failure path check treats only a missing or non-directory project as absence; permission and other operational errors keep the 503 response.The HEAD probe stays separate from status because
HEAD = ref: refs/heads/bad.lockmakesgit status --porcelain=v1 -bexit 0 with## A a.txt, whilegit branch --show-currentexits 128. A regression test pins that pair. One bounded subprocess runner keeps the existing timeout, kill/reap, sandbox, encoding, and byte-cap behavior in one place.The Git panel renders the no-repository state only when the status query has no error. A status failure puts muted “Branch unavailable” text in the branch slot and hides the branch, sync, clean, uncommitted, and changed-file rows. The independently loaded commit list stays visible, and the localized notice says its history may be out of date. The agent handoff keeps the raw endpoint, HTTP status, and backend code. The no-repository help tells users to click the folder name below the message box. Every shipped catalog and the pseudolocale carry both sentences. The status contract also records that the ChatPage badge, FileBrowserRail, and Pierre consumers receive 503 on operational failure and must not treat non-200 as “not a repository.”
The Files rail’s Changed mode (the Pierre workspace tree) treats the same 503 as an error state instead of a permanent loading skeleton, and one failure renders exactly one notice: Changed mode hands the failure to the tree’s own sentence, “Couldn’t read the repository status.”, and suppresses the rail’s status row, while All mode keeps the rail’s existing warning. The tree’s notice carries the structured error report, so “Ask the agent” keeps the endpoint, HTTP status, and backend code there too.
🟨 changed · 🟦 unchanged
Scope: this change covers
/api/project/git/status./api/project/git/logstill collapses discovery failures into an empty commit list; issue #10892 owns that work.Changed areas:
src/kiro_crew/dashboard/handlers/files.py,test/test_project_git_status_log.py,website/src/components/GitPanel.tsx,website/src/test/GitPanel.test.tsx,website/src/pages/chat/FileBrowserRail.tsx,website/src/pierre/PierreWorkspaceTreeImpl.tsx,website/src/test/PierreWorkspaceTreeImpl.test.tsx,website/src/i18n/locales/, anddocs/system-specs/modules/learn-cron-dashboard.md.Tests
.venv/bin/python -m pytest -n0 -q test/test_project_git_status_log.py test/test_project_git.py— 82 passed.npx vitest run src/test/GitPanel.test.tsx— 8 passed, including the muted placeholder, stale changed-file suppression, and Chinese structured-report handoff.npx tsc -b;I18N_BASE_REF=origin/main npx vitest run src/test/GitPanel.test.tsx src/test/PierreWorkspaceTreeImpl.test.tsx src/i18n/style/bnStyle.test.ts src/i18n/catalogParity.test.ts— passed, including the red-first assertion that a 503 in Changed mode renders exactly one alert in the Files rail;npm run lint:i18n,npm run i18n:check, andnpm run build— passed.npm run build— passed.I18N_BASE_REF=origin/main npm run i18n:check— 19 checks passed, including all diff-scoped checks.Manual verification
Scripted Playwright opened the staged bundle in an isolated pod. It selected a real repository, loaded its real commit list, returned a successful dirty status payload with one changed file, and then injected
503 {"error":"server-only repository status detail","code":"git_status_unavailable"}on Refresh. The panel showed one scoped localized sentence and muted “Branch unavailable” text. It hid stale branch, sync, clean, uncommitted, and changed-file data while keeping the commit list visible.Round 14 repeated the failure against a real repository whose
HEADreadsref: refs/heads/bad.lock, in an isolated pod on the amended bundle. The Git panel header read “Branch unavailable” beside the two-sentence notice, and the Files rail’s Changed mode showed exactly one notice with one “Ask the agent” link (the capture script fails on any other count).The same run selected
/local/home/txd, a real non-repository directory. The panel showed “Not a Git repository” and the exact instruction to click the folder name below the message box.kirocrew pod ls --jsonconfirmed the verification pod was gone afterward.Screenshots / video
Before
After — shipped no-repository guidance
Failed refresh — injected 503 (round 6; the branch slot now reads “Branch unavailable” — see the round-14 capture below)
Failed status — Git panel header (round 14)
Failed status — Files rail, Changed mode (round 14)
Related Issues
Fixes #10775
Pattern harvest
Rule candidate: review-prompt
Pattern: Let sandboxed Git produce the repository verdict; map only explicit absence to an empty state and keep later failures unavailable.
Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)