| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Render a dedicated missing-file state when the browse file-source API returns FILE_NOT_FOUND, preserving the active revision in the return-to-root link. Constraint: Prior closed PR sourcebot-dev#837 lost branch context and introduced a client-side component; this keeps the new panel server-rendered and revision-aware. Rejected: Keeping the raw service-error text | users need a browse-specific recovery path for deleted, moved, or branch-specific files. Confidence: high Scope-risk: narrow Directive: Keep other file-source service errors on the existing diagnostic error path; only FILE_NOT_FOUND should render this panel. Tested: node .yarn/releases/yarn-4.7.0.cjs workspace @sourcebot/web test 'src/app/(app)/browse/[...path]/components/codePreviewPanel/codePreviewPanel.test.tsx' Tested: node .yarn/releases/yarn-4.7.0.cjs workspace @sourcebot/web lint Not-tested: Manual browser navigation to a missing blob path.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting. Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughA dedicated missing-file panel is added for browse views. CodePreviewPanel now renders it for ErrorCode.FILE_NOT_FOUND responses, and tests verify the 404 UI and navigation links. A changelog entry records the change. ChangesFile Not Found State
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. ❤️ ShareComment @coderabbitai help to get the list of available commands. |
Sorry, something went wrong.
Constraint: Sourcebot requires a follow-up changelog entry for each PR under the matching Unreleased section. Confidence: high Scope-risk: narrow Directive: Keep this commit scoped to the changelog entry for PR sourcebot-dev#1381. Tested: Not run; changelog-only follow-up. Not-tested: Runtime tests unchanged from the implementation commit.
Merge upstream main after sourcebot-dev#1376 changed the same Unreleased changelog block, keeping both release-note entries. Constraint: GitHub reported PR sourcebot-dev#1381 as dirty against current main.\nRejected: Rewriting the open PR branch | Avoids force-pushing an existing review branch.\nConfidence: high\nScope-risk: narrow\nDirective: This merge commit should only resolve the changelog ordering conflict.\nTested: git diff --check\nNot-tested: Targeted regression test rerun follows after the merge commit.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agentsVerify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. Inline comments: In `@packages/web/src/app/`(app)/browse/[...path]/components/codePreviewPanel/codePreviewPanel.tsx: - Around line 66-69: The FileNotFoundPanel is using the fetch ref instead of the user’s browse revision, which can send the recovery link to the wrong root when previewRef is present. In codePreviewPanel.tsx, update the FileNotFoundPanel call to pass the browse revision value for its revisionName prop, and introduce a separate prop for previewRef only if the panel needs it for display copy. Use the codePreviewPanel and FileNotFoundPanel symbols to locate and adjust the prop wiring.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 73b03735-ab51-40db-8940-7ef21daeae8d
📥 CommitsReviewing files that changed from the base of the PR and between 82b5c1f and 78b2eb2.
📒 Files selected for processing (4)
Sorry, something went wrong.
Split the ref used for failed content lookup from the ref used for browse navigation, so preview-mode 404s keep their normal return path. Constraint: Existing previewRef semantics fetch content at the preview ref while keeping the surrounding browse context at revisionName. Rejected: Reusing contentRef for all missing-file panel navigation | that sends preview 404 recovery links to the commit root instead of the active browse revision. Confidence: high Scope-risk: narrow Directive: Keep missing-file copy tied to the failed content ref, but keep navigation tied to the browse revision. Tested: node .yarn/releases/yarn-4.7.0.cjs workspace @sourcebot/web test 'src/app/(app)/browse/[...path]/components/codePreviewPanel/codePreviewPanel.test.tsx' Tested: node .yarn/releases/yarn-4.7.0.cjs workspace @sourcebot/web lint Tested: git diff --check origin/main...HEAD Not-tested: Manual browser navigation through a real deleted-file preview link.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agentsVerify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@packages/web/src/app/`(app)/browse/[...path]/components/codePreviewPanel/codePreviewPanel.test.tsx:
- Around line 96-98: The root-link test in codePreviewPanel.test.tsx is
hard-coding the browse URL without the trailing slash, so it can fail even when
the component is correct. Update the expectation in the Return to repository
root assertion to match the actual output from getBrowsePath({ pathType: 'tree',
path: '' }) and keep the test aligned with the href produced by
codePreviewPanel.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b9b1d038-f9f2-4701-807e-aae9c554d298
📥 CommitsReviewing files that changed from the base of the PR and between 78b2eb2 and 47c3083.
📒 Files selected for processing (3)
Sorry, something went wrong.
Keep preview-mode header navigation anchored to the active browse revision while file content still loads from the preview ref. Constraint: The browse route treats previewRef as a content fetch override, not as the surrounding browse context. Rejected: Leaving PathHeader on contentRef | successful previews would keep breadcrumb/root navigation on the preview commit. Confidence: high Scope-risk: narrow Directive: Use contentRef only for content retrieval and editor context; use revisionName for browse navigation surfaces. Tested: node .yarn/releases/yarn-4.7.0.cjs workspace @sourcebot/web test 'src/app/(app)/browse/[...path]/components/codePreviewPanel/codePreviewPanel.test.tsx' Tested: node .yarn/releases/yarn-4.7.0.cjs workspace @sourcebot/web lint Tested: git diff --check origin/main...HEAD Not-tested: Manual browser navigation through a successful preview link.
Use the tooltip trigger as the existing link control so preview-mode close remains valid accessible markup. Constraint: The successful-preview header now participates in the same browse-context contract as the missing-file state. Rejected: Leaving a button wrapper around the link | creates nested interactive controls and weakens keyboard/accessibility behavior. Confidence: high Scope-risk: narrow Directive: Keep tooltip triggers composed with `asChild` when the child is already the interactive control. Tested: node .yarn/releases/yarn-4.7.0.cjs workspace @sourcebot/web test 'src/app/(app)/browse/[...path]/components/codePreviewPanel/codePreviewPanel.test.tsx' Tested: node .yarn/releases/yarn-4.7.0.cjs workspace @sourcebot/web lint Tested: git diff --check origin/main...HEAD Not-tested: Manual browser hover/focus over the preview close tooltip.
Prevent long missing paths and refs from overflowing the browse 404 panel on narrow panes. Constraint: Missing-file copy can contain full repository paths and full preview commit refs. Rejected: Truncating the missing path/ref | users need exact text for recovery and debugging. Confidence: high Scope-risk: narrow Directive: Prefer wrapping over truncation for diagnostic identifiers in error-state copy. Tested: node .yarn/releases/yarn-4.7.0.cjs workspace @sourcebot/web test 'src/app/(app)/browse/[...path]/components/codePreviewPanel/codePreviewPanel.test.tsx' Tested: node .yarn/releases/yarn-4.7.0.cjs workspace @sourcebot/web lint Tested: git diff --check origin/main...HEAD Not-tested: Manual browser resize with an extremely long missing path.
…browse-file-not-found # Conflicts: # CHANGELOG.md
| Back | FazBrowse Home | New Git URL |
Fixes #827
Problem
When a user browses to a blob path that does not exist, Sourcebot currently renders the raw service error (Error loading file source: ...). This can happen after changing branches, following an old link, or browsing a file that was deleted or moved.
Root cause
CodePreviewPanel treats all getFileSource service errors the same, so FILE_NOT_FOUND never gets a browse-specific recovery UI. Preview-mode browse also needs to keep two refs separate: the content ref used for the file lookup and the active browse revision used for navigation.
Solution
This also avoids the review issues from the old closed PR #837: the new panel is server-rendered and the root link keeps branch context.
Tests
Risk
Low. The branch is gated on the existing FILE_NOT_FOUND error code, and all other file-source errors still render their existing message. Preview ref handling is covered for both missing-file and successful-preview states.
Not tested
Manual browser navigation to a missing blob path.
Summary by CodeRabbit
Bug Fixes
Tests