Document viewer: compact indexed-source UI, 3-button action layout, and toggle/search fixes - #1818
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
📝 WalkthroughWalkthroughThe document viewer now uses the document composer for search input, resets indexed-text result navigation when queries change, and updates evidence controls, passage disclosure behavior, spacing, and regression tests. ChangesDocument viewer search and evidence
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed: dependency version conflict. Check your lock file or package.json. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e7a204f3a6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex resolve actionable Codex review findings for this pull request and current head using the repository instructions. This is the pull request's single automatic repair pass: do not perform a fresh review, create new standalone findings, or request another review. Work only the existing unresolved Codex threads on the current head. The only repository destination is BigSimmo/Database, and the only branch destination is the pull request head branch codex/optimize-layout-and-fix-toggle-bug at starting commit e7a204f; never publish fixes to a detached or synthetic work branch and never create a stacked pull request. Use the authenticated GitHub connector to commit each approved fix to BigSimmo/Database:codex/optimize-layout-and-fix-toggle-bug, then verify that the pull request head contains the published commit before reporting success. Always fix P0 and P1 findings. For P2 and lower findings, fix only clear, scoped, low-risk issues; otherwise disposition them with a concise reason. For a fixed thread, reply with as the first line and as the second line. For a no-code disposition, use followed by . These result markers authorize the workflow to close that exact thread only after it verifies a fixed commit is the pull request head; a local-only commit is not a fix. If publication or verification fails, do not use either result marker, do not claim success, and leave the thread open with the blocker. If human input or new authorization is required, do the same. Finish only after every actionable thread is fixed or dispositioned and closed, or explicitly left open for a human decision. Do not update the branch from main, address unrelated reviews, broaden scope, or create more than one scoped fix commit. Do not use external APIs, paid services, credentials, dependency changes, or broad refactors unless explicitly authorized. Add targeted tests where behavior changes and run the narrowest relevant validation. |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
Pull request overview
Compacts the document viewer’s source UI while consolidating search ownership and improving disclosure behavior.
Changes:
- Condenses cited passages and action controls.
- Removes duplicate indexed-text search input.
- Improves panel state handling and accessibility coverage.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/components/document-viewer/source-panels.tsx |
Updates source panels, controls, and reveal state. |
tests/ui-smoke.spec.ts |
Verifies composer ownership and passage toggling. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
babysit summary
Merge can be resumed once CI finishes; no additional blocker introduced by this tip. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify 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 `@tests/document-section-summary.dom.test.tsx`:
- Around line 206-211: Update the rerender case for IndexedTextPanel so changing
the search query to "head" preserves the original documentSearchResults array
and order. Keep this test focused on resetting the active hit due solely to the
query change, including the interim state where new-query results remain stale.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: c3e92102-b775-4079-98bb-c6693776c1db
📒 Files selected for processing (3)
src/components/document-viewer/source-panels.tsxtests/document-section-summary.dom.test.tsxtests/ui-smoke.spec.ts
PR summary (babysit sweep)Snapshot
Fix / disposition
Ledger
Remaining
|
Motivation
Description
line-clamp-2) and adding a stableidfor aria-controls; make the toggle button smaller and addaria-expanded/aria-controlsfor accessibility.useRef+useEffectpattern to avoid racey toggles and to respect deep-link/search reveal rules.onSearchChangeoptional onIndexedTextPaneland adjust the test expectation so the page-level composer is treated as the single search owner (the indexed-text panel no longer duplicates a large search field).src/components/document-viewer/source-panels.tsx,tests/ui-smoke.spec.ts(test expectation adjusted).Testing
npm run test -- tests/document-section-summary.dom.test.tsx(Vitest focused selection); result: 1 test file passed, 8 tests passed.npm run testfor the file andnpm run typecheck; result: unit tests passed and typecheck succeeded.tests/ui-smoke.spec.ts— "document viewer puts the PDF preview first with pinned evidence after it on mobile"); result: the targeted Playwright test passed (1 passed).npm run ensure/ local-server check andnpm run format; both completed without error.Codex Task
Summary by CodeRabbit
New Features
Bug Fixes