Skip to content

Conversation

@carlagn
Copy link
Contributor

@carlagn carlagn commented Aug 29, 2025

Fixes #DC-4959

Summary by CodeRabbit

  • Documentation

    • Standardized tabbed code blocks across docs (removed varied/transparent/full-width variants); code/examples unchanged.
    • Removed stray line breaks and excess spacing around some examples.
  • Style

    • Redesigned tab visuals: spacing, borders, hover/active indicators, and light-theme accents for clearer tabs.
    • Normalized margins in command/result blocks and increased terminal code line padding for improved readability.
    • Updated component backgrounds and theme variable usage for more consistent contrast.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 29, 2025

Walkthrough

Updated TabbedContent usage across MDX (removed/changed transparent and fullWidth props), removed legacy global TABS CSS, adjusted Tabs component class composition and full-width handling, and applied multiple SCSS/CSS tweaks for tab, code-block, terminal, and cmd/cmdresult spacing. No public API or runtime logic changes.

Changes

Cohort / File(s) Summary of Changes
MDX: TabbedContent prop updates
content/200-orm/200-prisma-client/100-queries/062-computed-fields.mdx, content/200-orm/200-prisma-client/600-observability-and-logging/130-logging.mdx, content/200-orm/300-prisma-migrate/300-workflows/10-seeding.mdx, content/200-orm/200-prisma-client/150-using-raw-sql/100-typedsql.mdx, content/200-orm/500-reference/050-prisma-client-reference.mdx
Removed or changed transparent / fullWidth props on TabbedContent; removed some stray <br/>/dash placeholders. Presentation-only edits; code examples unchanged.
Tabs component logic
src/theme/Tabs/index.tsx
Active tab class now composes global active class with CSS-module styles.activeTab; removed fullWidth param and now always applies styles['full-width'] to the container.
Tabs / TabItem styles
src/theme/Tabs/styles.module.scss, src/theme/TabItem/styles.module.scss
New/updated rules for tab layout, hover/active indicators, light-theme border, .code-children / .full-width handling, background/margin resets for code children and cmd results.
Global CSS cleanup
src/css/custom.css
Removed legacy TABS styling block; added language-terminal code > .token-line { padding: ... !important } to increase left padding for terminal token lines.
CodeBlock padding specificity
src/theme/CodeBlock/Line/styles.module.scss
Added !important to .noLineNumbers padding to raise specificity.
Cmd / cmdresult spacing tweaks
src/theme/styles.module.scss
Zeroed inner div margins for cmd > div > div and cmdresult > div > div to normalize spacing.
Getting started visuals
src/css/gettingStarted.module.scss
Updated .squareWrapper background from var(--header-bg-color) to var(--surface-primary); removed explicit transparent backgrounds; adjusted .list distribution to max-width: fit-content.
Theming variable cleanup
src/css/theming.css
Removed explicit --surface-primary: #090a15; override for dark theme so it now resolves to var(--gray-1000).

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant TabsComp as Tabs Component
  participant CSSModule as Tabs SCSS
  participant Browser

  Note over User,TabsComp: User clicks a tab
  User->>TabsComp: click(tab)
  TabsComp->>TabsComp: update selectedValue
  TabsComp->>CSSModule: compute applied classes (global + styles.activeTab)
  CSSModule-->>Browser: render styles (active/hover/full-width, code-child rules)
  Browser-->>User: updated tab UI and content
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • nikolasburk
  • nurul3101
  • Techboidesign
  • mhessdev

📜 Recent 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 0e1cdbd and 62cf409.

📒 Files selected for processing (1)
  • src/css/gettingStarted.module.scss (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/css/gettingStarted.module.scss
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/DC-4959-tabscontent

🪧 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.

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

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.

@github-actions
Copy link
Contributor

Dangerous URL check

No absolute URLs to prisma.io/docs found.
No local URLs found.

@github-actions
Copy link
Contributor

Redirect check

This PR probably requires the following redirects to be added to static/_redirects:

  • This PR does not change any pages in a way that would require a redirect.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Aug 29, 2025

Deploying docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 62cf409
Status: ✅  Deploy successful!
Preview URL: https://8bf078d6.docs-51g.pages.dev
Branch Preview URL: https://feat-dc-4959-tabscontent.docs-51g.pages.dev

View logs

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/theme/Tabs/index.tsx (1)

22-43: Improve keyboard a11y: Space/Home/End support and preventDefault

Add Space to activate the tab, and Home/End to jump to first/last. Prevent default on arrow/home/end to avoid incidental scrolling.

   const handleKeydown = (event) => {
     let focusElement = null;
     switch (event.key) {
       case "Enter": {
         handleTabChange(event);
         break;
       }
+      case " ": // Space
+      case "Spacebar": {
+        event.preventDefault();
+        handleTabChange(event);
+        break;
+      }
       case "ArrowRight": {
+        event.preventDefault();
         const nextTab = tabRefs.indexOf(event.currentTarget) + 1;
         focusElement = tabRefs[nextTab] ?? tabRefs[0];
         break;
       }
       case "ArrowLeft": {
+        event.preventDefault();
         const prevTab = tabRefs.indexOf(event.currentTarget) - 1;
         focusElement = tabRefs[prevTab] ?? tabRefs[tabRefs.length - 1];
         break;
       }
+      case "Home": {
+        event.preventDefault();
+        focusElement = tabRefs[0];
+        break;
+      }
+      case "End": {
+        event.preventDefault();
+        focusElement = tabRefs[tabRefs.length - 1];
+        break;
+      }
       default:
         break;
     }
     focusElement?.focus();
   };
🧹 Nitpick comments (5)
src/theme/styles.module.scss (1)

9-11: Harden selector; target both cmd and cmdResult with lower specificity

Current selector is brittle to DOM depth. Use :where() and a single group; keeps specificity low and intent clear.

-  cmd > div > div, cmdresult > div > div {
-    margin: 0;
-  }
+  :where(cmd, cmdresult) > div > div {
+    margin: 0;
+  }
src/theme/CodeBlock/Line/styles.module.scss (1)

83-86: Consolidate duplicate .noLineNumbers rules

You now have two .noLineNumbers blocks; the later overrides the earlier. Collapse into one to avoid confusion.

- .noLineNumbers {
-   margin: 0 -16px 0 0;
- }
-
-.noLineNumbers {
-  padding: 0 0 0 calc(var(--ifm-pre-padding)) !important;
-  margin: 0;
-}
+.noLineNumbers {
+  padding: 0 0 0 calc(var(--ifm-pre-padding)) !important;
+  margin: 0; /* if the -16px was intentional, restore it here instead */
+}
src/theme/TabItem/styles.module.scss (1)

17-25: Make selectors resilient and reduce !important usage

Align with custom elements in MDX and avoid over-specific depth assumptions.

-  > div, cmd > div {
-    background: transparent !important;
-    > div {
-      margin: 0;
-    }
-  }
-  cmdresult > div > div {
-    margin: 0;
-  }
+  > div,
+  :where(cmd) > div {
+    background: transparent; /* drop !important if not strictly needed */
+  }
+  > div > div,
+  :where(cmd, cmdresult) > div > div {
+    margin: 0;
+  }
src/css/custom.css (1)

1489-1492: Terminal prompt padding tweak: add trailing semicolon and confirm specificity

  • Add a trailing semicolon for consistency with the codebase’s style.
  • With !important here and also in CodeBlock/Line/styles.module.scss, confirm there’s no unintended override cascade on terminal blocks.

Apply:

-.language-terminal code > .token-line {
-  padding: 0 0 0 calc(var(--ifm-pre-padding) * 2) !important
-}
+.language-terminal code > .token-line {
+  padding: 0 0 0 calc(var(--ifm-pre-padding) * 2) !important;
+}
src/theme/Tabs/index.tsx (1)

68-69: Avoid space-joined class key in clsx

Using a computed object key with a space works but is brittle. Pass classes separately for clarity and tooling friendliness.

-          className={clsx("tabs__item", styles.tabItem, attributes?.className, {
-            [`tabs__item--active ${styles.activeTab}`]: selectedValue === value,
-          })}
+          className={clsx(
+            "tabs__item",
+            styles.tabItem,
+            attributes?.className,
+            selectedValue === value && "tabs__item--active",
+            selectedValue === value && styles.activeTab
+          )}
📜 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 5c4a19f and 4f5a431.

📒 Files selected for processing (9)
  • content/200-orm/200-prisma-client/100-queries/062-computed-fields.mdx (1 hunks)
  • content/200-orm/200-prisma-client/600-observability-and-logging/130-logging.mdx (1 hunks)
  • content/200-orm/300-prisma-migrate/300-workflows/10-seeding.mdx (3 hunks)
  • src/css/custom.css (1 hunks)
  • src/theme/CodeBlock/Line/styles.module.scss (1 hunks)
  • src/theme/TabItem/styles.module.scss (1 hunks)
  • src/theme/Tabs/index.tsx (1 hunks)
  • src/theme/Tabs/styles.module.scss (2 hunks)
  • src/theme/styles.module.scss (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). (2)
  • GitHub Check: runner / linkspector
  • GitHub Check: Lost Pixel
🔇 Additional comments (8)
content/200-orm/200-prisma-client/100-queries/062-computed-fields.mdx (1)

13-13: Verify removal of “transparent” doesn’t regress code block backgrounds/padding

Check light/dark themes and mobile for unintended background bleed or spacing shifts around CodeWithResult.

content/200-orm/200-prisma-client/600-observability-and-logging/130-logging.mdx (1)

74-74: Confirm visual parity after switching to

Previously there was custom transform/transparent styling. Please sanity-check spacing of the tab list vs. code on narrow viewports.

content/200-orm/300-prisma-migrate/300-workflows/10-seeding.mdx (3)

21-56: Standardizing TabbedContent to code looks good

Switching to <TabbedContent code> matches the new Tabs styling model and removes reliance on the old transparent variant.


80-107: Use of fullWidth is appropriate; please verify mobile overflow

<TabbedContent fullWidth> pairs with .tabList:has(.full-width) to expand the panel. Please sanity-check on small screens that long code lines don’t create horizontal overflow beyond the article grid.

Also applies to: 197-207


349-385: Consistent fullWidth usage across Bash/SQL tabs

Second use of fullWidth is consistent with the TS/JS example block.

src/theme/Tabs/styles.module.scss (3)

2-4: Light theme border color override—LGTM

Keeps content panel borders aligned with the light palette after removing global tabs CSS.


8-16: Container sizing: fit-content + full-width — verify wrapping behavior

width: fit-content with an override via :has(.full-width) is sensible. Please verify that tab labels wrap or scroll gracefully when many tabs are present, especially within narrow columns.

Also applies to: 33-38


83-88: Code panel background reset—LGTM

background: transparent !important; on pre avoids double backgrounds with the container. Good.

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

📜 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 4f5a431 and 4b39889.

📒 Files selected for processing (2)
  • content/200-orm/300-prisma-migrate/300-workflows/10-seeding.mdx (3 hunks)
  • src/theme/TabItem/styles.module.scss (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • content/200-orm/300-prisma-migrate/300-workflows/10-seeding.mdx
⏰ 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). (3)
  • GitHub Check: Check internal links
  • GitHub Check: runner / linkspector
  • GitHub Check: Lost Pixel
🔇 Additional comments (2)
src/theme/TabItem/styles.module.scss (2)

20-28: Ignore custom‐elements suggestion
Markup consistently uses <cmd> and <cmdresult> custom elements (no class="cmd" or class="cmdresult" found), so the existing element selectors in styles.module.scss are correct.

Likely an incorrect or invalid review comment.


17-19: Confirm intended shadow removal. Audit found no downstream rules reintroducing shadows; the > div override strips all box-shadows (including the CodeBlock container’s). Ensure this aligns with the new visual spec.

coderabbitai[bot]
coderabbitai bot previously approved these changes Aug 29, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Aug 29, 2025
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: 1

♻️ Duplicate comments (2)
src/theme/Tabs/styles.module.scss (2)

29-31: Scope fix: :has(.code-children) will not match — use :global() or change TabItem to use the module class
This was flagged earlier; still present. Since TabItem renders a literal class="code-children", the current selector won’t apply from a CSS module.

Use either approach (pick one and keep consistent):

  • Keep TabItem global class → globalize selector here:
-    &:has(.code-children) {
+    &:has(:global(.code-children)) {
       padding: 0;
     }
-  &:has(.code-children) {
+  &:has(:global(.code-children)) {
     width: auto;
   }
  • Or, change TabItem to use styles.codeChildren, then update selectors accordingly:
-    &:has(.code-children) {
+    &:has(.codeChildren) {
       padding: 0;
     }
-  &:has(.code-children) {
+  &:has(.codeChildren) {
     width: auto;
   }

Also applies to: 33-35


41-86: Add a visible keyboard focus state on tabs
No visible focus indication on .tabItem. Add :focus-visible for accessibility. (Echoing prior suggestion.)

Apply:

 .tabItem {
   margin-top: 0 !important;
+  &:focus-visible {
+    outline: 2px solid var(--ifm-color-primary);
+    outline-offset: 2px;
+  }
🧹 Nitpick comments (2)
src/theme/Tabs/styles.module.scss (2)

48-55: Remove duplicate alignment and obsolete vendor prefix
align-items is declared twice and -webkit-box-align is unnecessary in target browsers.

Apply:

-  align-items: center;
   border-radius: 4px 4px 0px 0px !important;
   background-color: var(--border-color);
   border: 1px solid transparent;
   cursor: pointer;
-  -webkit-box-align: center;
-  align-items: center;
+  align-items: center;
   display: flex;

23-26: Use theme font token instead of hardcoding Inter
Keeps typography consistent with site theming and avoids FOUC if Inter isn’t loaded.

-    font-family: Inter;
+    font-family: var(--ifm-font-family-base);
📜 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 4b03c69 and 459b28e.

📒 Files selected for processing (1)
  • src/theme/Tabs/styles.module.scss (2 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). (3)
  • GitHub Check: Check internal links
  • GitHub Check: runner / linkspector
  • GitHub Check: Lost Pixel
🔇 Additional comments (1)
src/theme/Tabs/styles.module.scss (1)

11-13: Ignore suggestion to globalize .full-width The class is applied via CSS Modules (styles['full-width'] in src/theme/Tabs/index.tsx), so both &:has(.full-width) and .full-width {…} in styles.module.scss are correctly scoped.

Likely an incorrect or invalid review comment.

coderabbitai[bot]
coderabbitai bot previously approved these changes Sep 1, 2025
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 (2)
src/css/gettingStarted.module.scss (2)

212-214: Keep tile background on hover in framed lists and add a safe fallback.

The base .squareWrapper:hover sets background: transparent, which overrides this framed variant. Also, add a fallback in case --surface-primary is missing.

   &.framedList {
@@
-    .squareWrapper {
-      background: var(--surface-primary);
-    }
+    .squareWrapper {
+      background: var(--surface-primary, var(--header-bg-color));
+    }
+    .squareWrapper:hover {
+      background: var(--surface-primary, var(--header-bg-color));
+    }

136-154: Remove redundant background; it’s immediately overridden.

background: var(--header-bg-color); is superseded by background: transparent; later in the same rule.

 .squareWrapper {
   width: 90px;
   height: 90px;
   text-decoration: none;
   padding: 22px;
   display: inline-block;
   border: 1px solid var(--border-color);
-  background: var(--header-bg-color);
   border-radius: 8px;
   transition: all 300ms ease-out;
   cursor: pointer;
 
   border-color: var(--ifm-btn-border-color);
   background: transparent;
📜 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 0a95278 and 2f3a002.

📒 Files selected for processing (6)
  • content/200-orm/200-prisma-client/150-using-raw-sql/100-typedsql.mdx (1 hunks)
  • content/200-orm/300-prisma-migrate/300-workflows/10-seeding.mdx (3 hunks)
  • content/200-orm/500-reference/050-prisma-client-reference.mdx (1 hunks)
  • src/css/gettingStarted.module.scss (1 hunks)
  • src/css/theming.css (0 hunks)
  • src/theme/Tabs/index.tsx (2 hunks)
💤 Files with no reviewable changes (1)
  • src/css/theming.css
✅ Files skipped from review due to trivial changes (2)
  • content/200-orm/200-prisma-client/150-using-raw-sql/100-typedsql.mdx
  • content/200-orm/500-reference/050-prisma-client-reference.mdx
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/theme/Tabs/index.tsx
  • content/200-orm/300-prisma-migrate/300-workflows/10-seeding.mdx
⏰ 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). (3)
  • GitHub Check: Check internal links
  • GitHub Check: runner / linkspector
  • GitHub Check: Lost Pixel

coderabbitai[bot]
coderabbitai bot previously approved these changes Sep 1, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Sep 1, 2025
Copy link

@Techboidesign Techboidesign left a comment

Choose a reason for hiding this comment

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

Thanks!

@carlagn carlagn merged commit c161461 into main Sep 1, 2025
9 checks passed
@carlagn carlagn deleted the feat/DC-4959-tabscontent branch September 1, 2025 10:18
jlecordier pushed a commit to jlecordier/docs-1 that referenced this pull request Sep 3, 2025
* Update UI for tabs

* Update tabbedcontent

* Update all tabbedcontent references

* Update seeding

* Update seeding spacings

* Add hover

* Update border thickness of tab items

* Update margin-bottom for codewithresult

* Update fullwidth as the default

* Update squarewrapper

* Update max-width and flex alignment
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.

3 participants