Skip to content

Conversation

@chmurson
Copy link
Collaborator

@chmurson chmurson commented Aug 25, 2025

What

  • border used instead of underline
  • color of the border is the same as text's but 50% opacity
Screenshot 2025-08-25 at 21 38 29 Screenshot 2025-08-25 at 21 38 35

@netlify
Copy link

netlify bot commented Aug 25, 2025

Deploy Preview for graypaper-reader ready!

Name Link
🔨 Latest commit b2a9f9c
🔍 Latest deploy log https://app.netlify.com/projects/graypaper-reader/deploys/68acbc0cbb353700085f5eff
😎 Deploy Preview https://deploy-preview-280--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.

@chmurson chmurson changed the title style: fix outline style - use border instead of underline; make it style: fix outline style - use border instead of underline; make it dimmer Aug 25, 2025
@coderabbitai
Copy link

coderabbitai bot commented Aug 25, 2025

Warning

Rate limit exceeded

@chmurson has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 15 minutes and 12 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 6353a76 and b2a9f9c.

📒 Files selected for processing (1)
  • src/components/Outline/Outline.tsx (2 hunks)

Walkthrough

The pull request updates class names in src/components/Outline/Outline.tsx to change link styling from underline to bottom border, adjusting color and spacing classes by outline level. No logic, behavior, or exports were modified.

Changes

Cohort / File(s) Summary
Outline item link styling
src/components/Outline/Outline.tsx
Replaced underline-based link styling with bottom-border classes; adjusted per-level text and border color classes; tweaked spacing (e.g., mt-0.5). No functional or export changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Various small styling improvements #273 — Also modifies src/components/Outline/Outline.tsx, restructuring types/props and rendering; touches the same component and may interact with the new styling.

Suggested reviewers

  • mateuszsikora
  • DrEverr
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch outline-change--lighter-underline

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 (5)
src/components/Outline/Outline.tsx (5)

123-129: Anchor without href isn’t keyboard-focusable; add key handling and semantics.

Using without href removes native keyboard focus/activation. At minimum, add tabIndex and onKeyDown for Enter/Space, or switch to a button with button semantics.

Apply this diff:

-function Link({ dest, children, className, onClick }: ILinkProps) {
-  return (
-    <a onClick={() => dest && onClick(dest)} className={twMerge("cursor-pointer hover:opacity-75", className)}>
-      {children}
-    </a>
-  );
-}
+function Link({ dest, children, className, onClick }: ILinkProps) {
+  const handleActivate = () => dest && onClick(dest);
+  const handleKeyDown: React.KeyboardEventHandler<HTMLAnchorElement> = (e) => {
+    if (e.key === "Enter" || e.key === " ") {
+      e.preventDefault();
+      handleActivate();
+    }
+  };
+  return (
+    <a
+      role="button"
+      tabIndex={0}
+      onClick={handleActivate}
+      onKeyDown={handleKeyDown}
+      className={twMerge(
+        "cursor-pointer hover:opacity-80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-black/30 dark:focus-visible:ring-white/30 rounded-[2px] transition-colors",
+        className,
+      )}
+    >
+      {children}
+    </a>
+  );
+}

If changing the element is acceptable, prefer a semantic button styled like a link.


69-70: Conflicting margin-top utilities; later mt-0.5 overrides mt-4.

twMerge will keep the last mt-*; for firstLevel, mt-4 is effectively ignored. If that’s intended, remove mt-4 for clarity.

Apply this diff:

-          <li key={item.title} className={twMerge(firstLevel ? "pl-0 mt-4" : "pl-4", "mt-0.5 first-of-type:mt-0")}>
+          <li key={item.title} className={twMerge(firstLevel ? "pl-0" : "pl-4", "mt-0.5 first-of-type:mt-0")}>

69-69: Key stability: item.title may collide; prefer a stable unique key.

If two outline items share a title, React reconciliation can misbehave. Use dest (if serializable) or include index as a suffix.

Apply this diff:

-          <li key={item.title} className={twMerge(firstLevel ? "pl-0" : "pl-4", "mt-0.5 first-of-type:mt-0")}>
+          <li
+            key={`${item.dest ?? item.title}-${index}`}
+            className={twMerge(firstLevel ? "pl-0" : "pl-4", "mt-0.5 first-of-type:mt-0")}
+          >
Note: If dest can be an object, stringify or hash it first.

---

`108-110`: **Hardcoded colors reduce theme consistency; consider using design tokens.**

bg-[#eeeeee] and dark:bg-[#323232] bypass your brand palette and won’t respond to theme changes. Prefer semantic Tailwind tokens or CSS variables.


Example (adjust to your tokens):

```diff
-    <div className="rounded-lg min-h-0 w-full py-6 px-6  bg-[#eeeeee] dark:bg-[#323232]  overflow-y-auto">
+    <div className="rounded-lg min-h-0 w-full py-6 px-6 bg-neutral-200 dark:bg-neutral-800 overflow-y-auto">

Or define brand-surface variables and reference them via bg-[var(--surface)].


88-92: Border color opacity may be too low for WCAG on some displays.

The /50 opacity on thin borders can be hard to perceive, especially in dark mode. Consider bumping to /60–/70 or increasing thickness on hover/focus.

If acceptable, tweak like:

-                  !firstLevel &&
-                    "dark:text-brand-light dark:border-brand-light/50 text-brand-dark border-brand-dark/50 mt-0.5",
+                  !firstLevel &&
+                    "dark:text-brand-light dark:border-brand-light/60 text-brand-dark border-brand-dark/60 mt-0.5",

To verify contrast against your palette, please confirm actual hex values in tailwind.config and test quickly in Storybook/screenshots.

📜 Review details

Configuration used: CodeRabbit UI

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 270b754 and 6353a76.

📒 Files selected for processing (1)
  • src/components/Outline/Outline.tsx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build

@tomusdrw
Copy link
Member

I like #281 better, I feel it's still too heavy. However I wonder if you could try border-bottom/text-underline only on the NON-numeric part of the chapter. If you have a spare minute could you introduce an extra span element there so that it could be styled separately?

@chmurson
Copy link
Collaborator Author

I like #281 better, I feel it's still too heavy. However I wonder if you could try border-bottom/text-underline only on the NON-numeric part of the chapter. If you have a spare minute could you introduce an extra span element there so that it could be styled separately?

Interesting request :) I've done as you suggested. Please double check 🙏

@chmurson chmurson force-pushed the outline-change--lighter-underline branch from ce685be to b2a9f9c Compare August 25, 2025 19:39
@chmurson
Copy link
Collaborator Author

@tomusdrw Would you like underline on hover for #281 ? btw

@tomusdrw tomusdrw merged commit b589a73 into main Aug 25, 2025
8 checks passed
@tomusdrw tomusdrw deleted the outline-change--lighter-underline branch August 25, 2025 21:27
@coderabbitai coderabbitai bot mentioned this pull request Oct 7, 2025
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