Skip to content

Fix document viewer sections to default closed - #683

Merged
BigSimmo merged 3 commits into
mainfrom
codex/documents-closed-default
Jul 15, 2026
Merged

Fix document viewer sections to default closed#683
BigSimmo merged 3 commits into
mainfrom
codex/documents-closed-default

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • make document viewer content disclosures closed and mutually exclusive by default
  • open requested sections from viewer navigation while preserving deep-linked evidence
  • keep printable summary content expanded only for the print lifecycle
  • close the nested table review queue and harden cold-server UI readiness

Verification

  • npm run verify:cheap
  • TypeScript and focused ESLint/Prettier
  • mocked Chromium viewer journeys on a clean Webpack dev server
  • git diff --check

No Supabase, OpenAI, or other live-provider checks were run.

Summary by CodeRabbit

  • New Features

    • Document viewer disclosure sections now start closed (including mobile) and open when selected via viewer navigation.
    • Viewer disclosures use mutually exclusive grouping for smoother browsing.
    • Viewer section headers were standardized for consistent interaction.
  • Bug Fixes

    • Printing behavior now expands the relevant disclosures before print and restores previous open/closed states afterward.
    • Navigation reliably opens the requested disclosure section and preserves printable summary content.
  • Tests

    • Updated and added UI smoke coverage for mobile default states, navigation toggling, and print-media visibility changes.

@supabase

supabase Bot commented Jul 15, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 89e0ba12-788c-4fb4-9b97-2269a845c741

📥 Commits

Reviewing files that changed from the base of the PR and between eec68d2 and e037e19.

📒 Files selected for processing (2)
  • src/components/DocumentViewer.tsx
  • tests/ui-smoke.spec.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/ui-smoke.spec.ts

📝 Walkthrough

Walkthrough

The document viewer now renders closed, mutually exclusive disclosure sections, opens sections through navigation links, expands printable content during print events, restores prior states, and adds UI coverage for these behaviors.

Changes

Document viewer disclosures

Layer / File(s) Summary
Disclosure structure and presentation
src/components/DocumentViewer.tsx
Disclosure summaries, mobile section grouping, source summary, source images, indexing details, and table-review queue markup were updated.
Navigation and print state
src/components/DocumentViewer.tsx, src/app/globals.css
Navigation opens target disclosures; print handlers expand printable sections and restore prior states while print CSS hides summaries and shows content.
Behavior validation and review record
tests/ui-smoke.spec.ts, docs/branch-review-ledger.md
UI tests verify closed defaults, exclusive navigation, print transitions, readiness, and DOM integrity; the review ledger records the changes.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant DocumentViewerAnchors
  participant DetailsSections
  participant PrintLifecycle
  User->>DocumentViewerAnchors: Click viewer section link
  DocumentViewerAnchors->>DetailsSections: Open target details element
  PrintLifecycle->>DetailsSections: Expand printable sections
  PrintLifecycle->>DetailsSections: Restore previous open states
Loading

Possibly related PRs

Suggested reviewers: claude, copilot

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: document viewer sections default closed.
Description check ✅ Passed The description includes the required Summary and Verification sections and covers the main implementation and checks.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/documents-closed-default

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eec68d2ee7

ℹ️ 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".

Comment thread src/components/DocumentViewer.tsx Outdated
@BigSimmo

Copy link
Copy Markdown
Owner Author

@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. 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. After fixing or dispositioning a thread, reply in that thread with as the first line, followed by a concise summary; that marker authorizes the workflow to close that exact thread. If human input or new authorization is required, do not use the marker and leave the thread open with the blocker. 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 `@src/components/DocumentViewer.tsx`:
- Around line 1610-1622: Update the disclosure print handling around
expandPrintableDisclosures and restorePrintableDisclosures in
src/components/DocumentViewer.tsx#L1610-L1622 to snapshot all named group
members, close the group before restoration, and reopen the previously open
member; add the targeted Images pre-open/regression assertion in
tests/ui-smoke.spec.ts#L2978-L2985, then retain the preservation claim in
docs/branch-review-ledger.md#L560-L560 only after that test passes.
🪄 Autofix (Beta)

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 Plus

Run ID: 9a8eae15-2a3e-4982-a7bd-2c02e65904e4

📥 Commits

Reviewing files that changed from the base of the PR and between 8dfc03e and eec68d2.

📒 Files selected for processing (4)
  • docs/branch-review-ledger.md
  • src/app/globals.css
  • src/components/DocumentViewer.tsx
  • tests/ui-smoke.spec.ts

Comment thread src/components/DocumentViewer.tsx
@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

  • Fixed the print lifecycle so it snapshots both printable disclosures and the native name="document-viewer-section" disclosure group before forcing print-only content open, then restores the original active disclosure afterward. src/components/DocumentViewer.tsxL1609-L1624
  • Added focused UI-smoke coverage for opening Images, triggering beforeprint/afterprint, and verifying Images is restored while Summary returns closed. tests/ui-smoke.spec.tsL2994-L3006
  • Committed the fix on the current branch: e16dd45 fix(documents): restore active section after print.
  • Created PR metadata with the make_pr tool: Fix document viewer print disclosure restoration.

Testing

  • PATH=/root/.nvm/versions/node/v24.15.0/bin:$PATH npm ci
  • PATH=/root/.nvm/versions/node/v24.15.0/bin:$PATH npm run typecheck
  • PATH=/root/.nvm/versions/node/v24.15.0/bin:$PATH npm run lint -- --quiet
  • git diff --check
  • ⚠️ PATH=/root/.nvm/versions/node/v24.15.0/bin:$PATH npm run test:e2e:chromium -- tests/ui-smoke.spec.ts --grep "document viewer content disclosures" — interrupted after the local Next/Turbopack server repeatedly failed to compile Google font internals while fetching fonts.gstatic.com resources in this environment.

View task →

@BigSimmo
BigSimmo merged commit 2155e35 into main Jul 15, 2026
28 checks passed
@BigSimmo
BigSimmo deleted the codex/documents-closed-default branch July 17, 2026 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant