Skip to content

Conversation

@chmurson
Copy link
Collaborator

@chmurson chmurson commented Aug 27, 2025

Summary by CodeRabbit

  • Style

    • Loading indicator in the PDF viewer now inherits page background and uses a subtle fade-in for a seamless appearance.
    • Dark mode handling streamlined: enabled via a root-level class and no longer forces a specific color scheme, better respecting system/browser preferences.
  • Accessibility

    • PDF loading indicator now exposes ARIA status attributes for improved screen reader feedback.
  • Bug Fixes

    • Fixed inconsistent overlay color during PDF page loading in some themes.

@netlify
Copy link

netlify bot commented Aug 27, 2025

Deploy Preview for graypaper-reader ready!

Name Link
🔨 Latest commit 645f8d2
🔍 Latest deploy log https://app.netlify.com/projects/graypaper-reader/deploys/68aed01c483ab400083bae86
😎 Deploy Preview https://deploy-preview-296--graypaper-reader.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link

coderabbitai bot commented Aug 27, 2025

Walkthrough

Updates PdfViewer loading markup and CSS so the loading overlay inherits the page background and includes ARIA attributes and a fade-in class. Theme handling moves color-scheme control from HTML selectors to a root-level .dark class and removes explicit color-scheme directives from Tailwind.

Changes

Cohort / File(s) Summary
PdfViewer component & styles
src/components/PdfViewer/PdfViewer.tsx, src/components/PdfViewer/PdfViewer.css
Loading UI now renders a div with classes pdf-viewer-loading bg-inherit animate-fade-in and ARIA attributes (role="status", aria-live="polite", aria-busy="true"). CSS adds .pdfViewer .page.loading::after { background-color: inherit; }.
Root theme / color-scheme
src/index.css, src/tailwind.css
Switches theme control to :root { color-scheme: light; } plus a .dark { color-scheme: dark; } class on root; removes html.light/html.dark selectors and drops explicit color-scheme rules from Tailwind CSS.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant App
  participant PdfViewer
  participant DOM
  participant CSS as "CSS (root/.dark + component)"

  User->>App: Open document
  App->>PdfViewer: mount / request PDF
  PdfViewer->>DOM: render loading div with classes + ARIA
  DOM->>CSS: resolve styles (fade-in, bg-inherit)
  CSS-->>DOM: overlay ::after inherits page background
  PdfViewer->>DOM: render pages when pdfDocument available
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • DrEverr
  • mateuszsikora

Poem

I nibble CSS and hop through the night,
A fading overlay settles just right.
Root-level dark, a classy little dance,
Pages appear after a patient glance.
Hooray — styles polished with a rabbit's prance 🥕🐇

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between fd37901 and 645f8d2.

📒 Files selected for processing (1)
  • src/components/PdfViewer/PdfViewer.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}

⚙️ CodeRabbit configuration file

When reviewing Tailwind CSS classes, ensure they follow Tailwind 4.x conventions and suggest modern 4.x alternatives for deprecated patterns.

Files:

  • src/components/PdfViewer/PdfViewer.tsx
🔇 Additional comments (1)
src/components/PdfViewer/PdfViewer.tsx (1)

109-114: Good a11y and theme inheritance on loader

Nice: role/status + aria-live/aria-busy added, and bg-inherit applied. Also good removal of the no-op theme injection.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-auto-light-dark-color-scheme2

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/components/PdfViewer/PdfViewer.css (1)

32-34: Make the overlay override resilient to upstream background shorthands

Use background instead of background-color to reliably trump pdfjs-dist’s background declarations (if any) on the pseudo-element.

-.pdfViewer .page.loading::after{
-  background-color: inherit;
-}
+.pdfViewer .page.loading::after{
+  /* Ensure we override any `background` shorthand from pdfjs-dist */
+  background: inherit;
+}
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between adcc16a and fd37901.

📒 Files selected for processing (4)
  • src/components/PdfViewer/PdfViewer.css (1 hunks)
  • src/components/PdfViewer/PdfViewer.tsx (1 hunks)
  • src/index.css (1 hunks)
  • src/tailwind.css (0 hunks)
💤 Files with no reviewable changes (1)
  • src/tailwind.css
🧰 Additional context used
📓 Path-based instructions (2)
**/*.css

⚙️ CodeRabbit configuration file

Review CSS code with focus on Tailwind CSS 4.x best practices and conventions. Ensure compatibility with Tailwind 4.x features and syntax.

Files:

  • src/components/PdfViewer/PdfViewer.css
  • src/index.css
**/*.{js,jsx,ts,tsx}

⚙️ CodeRabbit configuration file

When reviewing Tailwind CSS classes, ensure they follow Tailwind 4.x conventions and suggest modern 4.x alternatives for deprecated patterns.

Files:

  • src/components/PdfViewer/PdfViewer.tsx
🔇 Additional comments (1)
src/index.css (1)

1-8: Action Required: Please Confirm Dark-Mode Toggle Scope

I searched the codebase for any classList.add/remove/toggle('dark') invocations and found no matches. Without knowing how your dark-mode toggle is implemented, it’s unclear whether .dark is ever applied at the root level (<html>/:root). Please verify that your toggle mechanism targets the root element to ensure the CSS change below will work as intended.

• Search performed:

rg -nP 'classList\.(add|remove|toggle)\(\s*["'\'']dark["'\'']\s*\)'

└─ no matches found
• If you use a framework-specific API (e.g. React, Vue, Angular), confirm it adds .dark to <html> or <body>, not deeper in the DOM.

Suggested optional refactor (scope dark mode to root):

- .dark {
+ :root.dark {
    color-scheme: dark;
  }

@chmurson chmurson merged commit e13b7ca into main Aug 27, 2025
7 of 8 checks passed
@chmurson chmurson deleted the fix-auto-light-dark-color-scheme2 branch August 27, 2025 09:32
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