Skip to content

Conversation

@chmurson
Copy link
Collaborator

@chmurson chmurson commented Sep 2, 2025

Summary by CodeRabbit

  • New Features

    • Added a GitHub dropdown menu to the header (visible on very wide screens); header action buttons now adapt to breakpoints and hide on small screens.
  • Bug Fixes

    • Improved layout stability by switching viewport units to svw/svh to prevent cutoff/resize jumps.
    • Adjusted resizable panel and app sizing for more consistent behavior across devices.
    • Tweaked stylesheet load order for more predictable styling.
  • Chores

    • Updated shared UI dependency to the latest minor version.

@coderabbitai
Copy link

coderabbitai bot commented Sep 2, 2025

Walkthrough

Updated dependency to @fluffylabs/shared-ui@^0.2.0, switched several CSS viewport units from vh/vw to svh/svw, adjusted import order in main.tsx, removed a Tailwind @source at-rule (replaced with a comment), added breakpoint-driven conditional rendering in Header, and typed/forwarded a className prop on NotesButtonsGroup.

Changes

Cohort / File(s) Summary
Dependency bump
package.json
Update @fluffylabs/shared-ui from ^0.1.7 to ^0.2.0.
Viewport unit changes
src/App.css, src/components/Resizable/Resizable.css, src/index.css
Replace vh/vw with svh/svw in height/width calculations.
Header composition & props
src/components/Header/Header.tsx, src/components/Header/components/NotesButtonsGroup.tsx
Import and use useBreakpoint; conditionally render NotesButtonsGroup and FluffyHeader.GithubDropdownMenu based on breakpoints; change NotesButtonsGroup signature to FC<{ className?: string }> and forward className.
Import / stylesheet order
src/main.tsx
Reorder imports: move shared-ui stylesheet after Tailwind; move App import to after font.css.
Tailwind source directive
src/tailwind.css
Remove @source at-rule and replace with an identical-path comment.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Browser
  participant Header as Header.tsx
  participant SharedUI as @fluffylabs/shared-ui

  Browser->>Header: render Header
  Header->>SharedUI: useBreakpoint("(width > 64rem)")
  Header->>SharedUI: useBreakpoint("(width > 52rem)")
  alt width > 64rem
    Header->>Header: render NotesButtonsGroup (if >52rem) + Version + GithubDropdownMenu
  else width between 52rem and 64rem
    Header->>Header: render NotesButtonsGroup + Version (no GithubDropdownMenu)
  else width <= 52rem
    Header->>Header: render Version only (NotesButtonsGroup hidden)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • DrEverr
  • mateuszsikora

Poem

In svh skies my panels grow,
A dropdown peeks where breakpoints show.
ClassName tucked, the buttons hide,
Shared UI hops to the newer side.
Tailwind’s source now whispers low — code-carrot nibble, onward we go! 🥕🐇

✨ 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-header-for-mobile

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 or @coderabbit 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.

@netlify
Copy link

netlify bot commented Sep 2, 2025

Deploy Preview for graypaper-reader ready!

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

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

🧹 Nitpick comments (7)
src/components/Resizable/Resizable.css (1)

3-3: Add 100vh fallback (and consider dvh) for broader mobile support.

Older browsers that don’t support svh will ignore the height. Layer a vh fallback first.

-  height: calc(100svh - var(--header-height));
+  /* Fallback for browsers without svh support */
+  height: calc(100vh - var(--header-height));
+  /* Stable viewport height on modern browsers */
+  height: calc(100svh - var(--header-height));

Optional: consider 100svw for width to avoid rare 100vw overflow on mobile browsers with overlays.

src/tailwind.css (1)

1-1: Removing @source may drop Tailwind v4 styles for shared-ui. Re-enable it.

If shared-ui components rely on Tailwind utilities, dropping @source can cause purging. Restore with a proper glob.

-/*@source "../node_modules/@fluffylabs/shared-ui/dist/";*/
+@source "../node_modules/@fluffylabs/shared-ui/dist/**/*.{js,jsx,ts,tsx}";

If your app sources aren’t declared elsewhere, also include:
@source "./src/**/*.{js,jsx,ts,tsx,html}";

src/App.css (1)

3-3: Add 100vh fallback before svh.

Keeps layout working on older mobile browsers.

-  height: 100svh;
+  height: 100vh;   /* fallback */
+  height: 100svh;  /* stable viewport */
src/index.css (1)

38-39: Layer vw/vh fallbacks before svw/svh.

Prevents regressions on browsers without new viewport units.

-  min-width: 100svw;
-  min-height: 100svh;
+  min-width: 100vw;   /* fallback */
+  min-height: 100vh;  /* fallback */
+  min-width: 100svw;  /* stable viewport */
+  min-height: 100svh; /* stable viewport */
src/main.tsx (1)

9-15: CSS order change (shared-ui after Tailwind) and moving App import — LGTM.

This cascade helps shared-ui styles layer over Tailwind preflight; loading CSS before App can reduce FOUC. Consider adding a short comment to keep this order intentional.

 import "./tailwind.css";
 import "@fluffylabs/shared-ui/style.css";
 import "./variables.css";
 import "./index.css";
 import "./font.css";
+// Keep CSS order: tailwind -> shared-ui -> variables -> app styles -> fonts
src/components/Header/Header.tsx (2)

13-19: Unify endSlot into a single flex container for alignment consistency.

Keeps spacing predictable and avoids relying on nested/floating siblings.

-        <>
-          <div className="flex pl-4">
-            <NotesButtonsGroup className="max-sm:hidden" />
-            <Version />
-          </div>
-          <FluffyHeader.GithubDropdownMenu className="max-sm:hidden" />
-        </>
+        <div className="flex items-center gap-2 pl-4">
+          <NotesButtonsGroup className="max-sm:hidden" />
+          <Version />
+          <FluffyHeader.GithubDropdownMenu className="max-sm:hidden" />
+        </div>

13-19: Follow-up: align viewport units across menus.

Version dropdown uses max-h-[60vh] (in Version.tsx); consider switching to svh for consistency with the rest of the PR to avoid iOS URL-bar jumps. Low priority.

📜 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 1099e07 and 6f42184.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (8)
  • package.json (1 hunks)
  • src/App.css (1 hunks)
  • src/components/Header/Header.tsx (1 hunks)
  • src/components/Header/components/NotesButtonsGroup.tsx (1 hunks)
  • src/components/Resizable/Resizable.css (1 hunks)
  • src/index.css (1 hunks)
  • src/main.tsx (1 hunks)
  • src/tailwind.css (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{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/main.tsx
  • src/components/Header/components/NotesButtonsGroup.tsx
  • src/components/Header/Header.tsx
**/*.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/Resizable/Resizable.css
  • src/index.css
  • src/App.css
  • src/tailwind.css
🧬 Code graph analysis (2)
src/components/Header/components/NotesButtonsGroup.tsx (1)
src/components/NotesProvider/NotesProvider.tsx (2)
  • NotesContext (17-17)
  • INotesContext (19-38)
src/components/Header/Header.tsx (2)
src/components/Header/components/NotesButtonsGroup.tsx (1)
  • NotesButtonsGroup (8-69)
src/components/Version/Version.tsx (1)
  • Version (16-104)
🔇 Additional comments (3)
src/components/Header/components/NotesButtonsGroup.tsx (1)

2-2: LGTM: typed FC and className pass-through are clean.

Public API clarified; forwarding className to ButtonGroup enables responsive control from Header.

Also applies to: 8-8, 15-15

package.json (1)

22-22: Approve bump to @fluffylabs/shared-ui ^0.2.0 — peerDeps are only React ^19.0.0/React-DOM ^19.0.0 (our React ^19.1.0 satisfies them) and GithubDropdownMenu is exported in dist/index.{js,d.ts}.

src/components/Header/Header.tsx (1)

13-19: Mobile cleanup via max-sm:hidden — looks correct.

Using max-sm:hidden aligns with Tailwind 4’s breakpoint range variants. ✔️ (tailwindcss.com)

@chmurson chmurson merged commit fa27b48 into main Sep 2, 2025
7 of 8 checks passed
@chmurson chmurson deleted the fix-header-for-mobile branch September 2, 2025 16:37
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: 0

🧹 Nitpick comments (2)
src/components/Header/Header.tsx (2)

8-9: Use inclusive range and avoid magic numbers.

Prefer >= to match typical “min-width” semantics and avoid off‑by‑one edge at exactly 64rem/52rem. Optionally extract to named constants.

-  const isLargeOrWider = useBreakpoint("(width > 64rem)");
-  const isCustomMediumOrWider = useBreakpoint("(width > 52rem)");
+  const isLargeOrWider = useBreakpoint("(width >= 64rem)"); // ~ Tailwind lg
+  const isCustomMediumOrWider = useBreakpoint("(width >= 52rem)");

16-22: Remove non-standard Tailwind variant and stray class; rely on the hook.

Tailwind 4.x doesn’t ship a max-sm: variant by default; these classes won’t apply. They’re also redundant due to conditional rendering. The bare “dark” class has no effect.

-          <div className="rounded-md flex ml-4 z-10 dark bg-[var(--card)]">
-            {isCustomMediumOrWider && <NotesButtonsGroup className="max-sm:hidden" />}
+          <div className="rounded-md flex ml-4 z-10 bg-[var(--card)]">
+            {isCustomMediumOrWider && <NotesButtonsGroup />}
             <Version />
           </div>
-          {isLargeOrWider && <FluffyHeader.GithubDropdownMenu className="max-sm:hidden" />}
+          {isLargeOrWider && <FluffyHeader.GithubDropdownMenu />}

Also, sanity-check that FluffyHeader doesn’t already render a GH control when ghRepoName is set to avoid duplication.

📜 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 6f42184 and c50ed63.

📒 Files selected for processing (1)
  • src/components/Header/Header.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/Header/Header.tsx
🧬 Code graph analysis (1)
src/components/Header/Header.tsx (2)
src/components/Header/components/NotesButtonsGroup.tsx (1)
  • NotesButtonsGroup (8-69)
src/components/Version/Version.tsx (1)
  • Version (16-104)
🔇 Additional comments (1)
src/components/Header/Header.tsx (1)

1-1: Verify shared-ui version compatibility for new APIs.

Confirm @fluffylabs/shared-ui >= 0.2.0 is in package.json/lockfile so useBreakpoint and FluffyHeader.GithubDropdownMenu are available at runtime.

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