Skip to content

fix: bug in color loading text in file viewer #2011

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2025

Conversation

kemuru
Copy link
Contributor

@kemuru kemuru commented May 27, 2025

(before)
WhatsApp Image 2025-05-28 at 01 28 28 (1)

PR-Codex overview

This PR focuses on adding a new CSS rule for loading states in the FileViewer component, enhancing its styling during loading.

Detailed summary

  • Added a new CSS rule for elements with a class containing --loading.
  • The new rule sets the color property to the secondaryText value from the theme.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • Style
    • Updated loading state text color in the file viewer to improve visual consistency with the app’s theme.

@kemuru kemuru requested a review from a team as a code owner May 27, 2025 23:27
Copy link

netlify bot commented May 27, 2025

Deploy Preview for kleros-v2-testnet ready!

Name Link
🔨 Latest commit 20ee602
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-testnet/deploys/68364a49820ae200089ceb97
😎 Deploy Preview https://deploy-preview-2011--kleros-v2-testnet.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.

Copy link

netlify bot commented May 27, 2025

Deploy Preview for kleros-v2-neo ready!

Name Link
🔨 Latest commit 20ee602
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-neo/deploys/68364a49e13f250008dc1b65
😎 Deploy Preview https://deploy-preview-2011--kleros-v2-neo.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.

Copy link

netlify bot commented May 27, 2025

Deploy Preview for kleros-v2-testnet-devtools ready!

Name Link
🔨 Latest commit 20ee602
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-testnet-devtools/deploys/68364a49bd8b1900084a5b39
😎 Deploy Preview https://deploy-preview-2011--kleros-v2-testnet-devtools.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.

@kemuru kemuru requested a review from alcercu May 27, 2025 23:27
Copy link
Contributor

coderabbitai bot commented May 27, 2025

Walkthrough

A new CSS rule was added to the StyledDocViewer styled component in the FileViewer. This rule targets elements with class names containing --loading and applies the theme's secondaryText color to their text. No other logic or exported entities were changed.

Changes

File(s) Change Summary
web/src/components/FileViewer/index.tsx Added CSS rule to style --loading class elements with secondaryText color

Poem

In the viewer where files unfold,
A loading state now shines, not cold.
With colors set just right and neat,
Secondary text makes loading sweet.
A gentle tweak, a subtle hue—
The rabbit hops and thanks the crew!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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 or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • 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

codeclimate bot commented May 27, 2025

Code Climate has analyzed commit 20ee602 and detected 0 issues on this pull request.

View more on Code Climate.

Copy link

Copy link
Contributor

@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: 0

🧹 Nitpick comments (1)
web/src/components/FileViewer/index.tsx (1)

28-30: Document intent and enforce override
Add a comment explaining the rule’s purpose and use !important to ensure it overrides the default viewer styles. For example:

@@ styled(DocViewer)`
   #pdf-controls {
     z-index: 3;
   }

-  [class*="--loading"] {
-    color: ${({ theme }) => theme.secondaryText};
-  }
+  /* Apply secondaryText color to all loading state elements within the DocViewer */
+  && [class*="--loading"] {
+    color: ${({ theme }) => theme.secondaryText} !important;
+  }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3f532d2 and 20ee602.

📒 Files selected for processing (1)
  • web/src/components/FileViewer/index.tsx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (15)
  • GitHub Check: Redirect rules - kleros-v2-testnet-devtools
  • GitHub Check: Redirect rules - kleros-v2-testnet
  • GitHub Check: Redirect rules - kleros-v2-testnet
  • GitHub Check: Redirect rules - kleros-v2-neo
  • GitHub Check: SonarCloud
  • GitHub Check: contracts-testing
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Header rules - kleros-v2-testnet-devtools
  • GitHub Check: Header rules - kleros-v2-testnet
  • GitHub Check: Header rules - kleros-v2-testnet
  • GitHub Check: Header rules - kleros-v2-neo
  • GitHub Check: Pages changed - kleros-v2-neo
  • GitHub Check: Pages changed - kleros-v2-testnet-devtools
  • GitHub Check: Pages changed - kleros-v2-testnet
  • GitHub Check: Pages changed - kleros-v2-testnet
🔇 Additional comments (1)
web/src/components/FileViewer/index.tsx (1)

28-30: Verify the CSS selector scope and specificity
The attribute selector [class*="--loading"] targets any descendant whose class contains --loading, which may unintentionally match other elements. Consider narrowing the scope (e.g., prefixing with && to increase specificity) or targeting the exact BEM class name that react-doc-viewer uses for its loading state.

Can you confirm this selector only affects the intended loading indicators and doesn’t conflict with other components?

Copy link

netlify bot commented May 27, 2025

Deploy Preview for kleros-v2-university failed. Why did it fail? →

Name Link
🔨 Latest commit 20ee602
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-university/deploys/68364a4902a58300080db05b

Copy link
Contributor

@alcercu alcercu left a comment

Choose a reason for hiding this comment

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

lgtm

@alcercu alcercu merged commit 282b91d into dev May 28, 2025
20 of 26 checks passed
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.

2 participants