Skip to content

Conversation

@shinokada
Copy link
Collaborator

@shinokada shinokada commented Nov 13, 2025

🔗 Related issue (optional)

Closes: #1841, #1839


📑 Description


🔍 PR Type

  • Bug fix
  • Feature
  • Documentation
  • Refactor / Code cleanup
  • Build / Tooling
  • Other (please describe)

🚦 PR Status

  • Draft (work in progress, not ready for review)
  • Ready for review ✅

✅ Checklist

  • My code follows the existing code style
  • I have run pnpm check && pnpm test:e2e and all tests pass
  • CoderabbitAI review has been completed and actionable suggestions were reviewed
  • I have updated documentation if my changes require it
  • I have updated the api-check directory if a component API changed
  • My PR is based on the latest main branch (not the published npm version)
  • I have checked accessibility where applicable (ARIA, keyboard nav, etc.)
  • I have reviewed the rendered component in the browser

🧪 Screenshots / Demos (optional)


⚠️ Breaking Changes (optional)


ℹ️ Additional Information

Summary by CodeRabbit

  • New Features

    • Dynamic TypeScript example loading with improved language-aware highlighting
    • Button loading state supports a configurable spinner
  • Documentation

    • Unified, data-driven rendering of code examples across docs
    • Added live loading button examples
  • Style

    • Datepicker range accent updated from pink to blue
  • Chores

    • Updated highlighting package and replaced legacy local highlighter with external component

@vercel
Copy link

vercel bot commented Nov 13, 2025

@shinokada is attempting to deploy a commit to the Themesberg Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 13, 2025

Walkthrough

Removes a local HighlightCompo and its theme export, adopts svelte-rune-highlight across docs and pages, switches examples/pages to eager import.meta.glob loading for example sources/components, adds Button.spinnerProps and a button theme spinner slot, tweaks datepicker dayButton colors, fixes spinner type name, and bumps svelte-rune-highlight in package.json.

Changes

Cohort / File(s) Summary
Docs — TypeScript highlighting
src/routes/docs/pages/typescript.md
Replace static TypeList highlighting with eager import.meta.glob loading of ../../../lib/types.ts as raw; register TypeScript language with highlight.js and pass a language object into external Highlight/HighlightCompo.
Highlight removal & theme
src/routes/utils/HighlightCompo.svelte, src/routes/utils/theme.ts
Remove local HighlightCompo.svelte and the exported highlightcompo Tailwind-Variants configuration; callers switched to svelte-rune-highlight components.
Glob-based examples wiring
src/routes/docs-examples/extend/clipboard-manager/+page.svelte, src/routes/docs-examples/*
Replace per-example inline wrappers with eager globbing of example components and raw modules; transform into maps via transformComponents/transformModules and render with ExampleWrapper + external HighlightCompo.
Pages switched to external highlighter
src/routes/admin-dashboard/(sidebar)/quickstart/+page.svelte, src/routes/builder/skeleton/+page.svelte
Swap local HighlightCompo imports for svelte-rune-highlight imports (HighlightAuto / named HighlightCompo) and adjust usage (remove codeLang, use language/code).
Button API & examples
src/lib/buttons/Button.svelte, src/lib/buttons/theme.ts, src/lib/types.ts, src/routes/docs-examples/components/buttons/Loader.svelte
Add spinnerProps prop to Button component and ButtonProps type; add spinner slot token to button theme; replace inline SVG loader with Spinner component; add examples demonstrating spinnerProps.
Spinner type rename
src/lib/spinner/theme.ts
Fix misspelled exported type alias: SpinnerVaraiantsSpinnerVariants.
Datepicker color tweak
src/lib/datepicker/theme.ts, src/routes/docs-examples/components/datepicker/Range.svelte
Change dayButton background tokens from bg-<color>-100 to bg-<color>-300; update example color from pink to blue.
Dependency bump
package.json
Update devDependency svelte-rune-highlight from ^0.7.1 to ^0.11.0.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Page as Doc / Example Page
  participant Importer as import.meta.glob (eager)
  participant Transformer as transformModules/transformComponents
  participant HighlightPkg as svelte-rune-highlight
  participant HLJS as highlight.js (typescript)

  Page->>Importer: eager import raw example modules & components
  Importer-->>Transformer: provide module & component entries
  Transformer-->>Page: produce `examples` and `components` maps
  Page->>HLJS: import & register TypeScript language -> build tsLang object
  Page->>HighlightPkg: render HighlightCompo with code=examples[key], language=tsLang
  HighlightPkg->>HLJS: register/format using provided language
  HighlightPkg-->>Page: highlighted code block rendered
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Verify all prior call sites of removed src/routes/utils/HighlightCompo.svelte now import and use svelte-rune-highlight correctly and that prop changes (code vs codeLang / language) match the new API.
  • Confirm eager import.meta.glob paths and raw loading resolve in build and that transformComponents/transformModules produce expected maps.
  • Check Button typing (spinnerProps) and the new spinner slot in button theme for backward compatibility and usage in examples.
  • Ensure highlight.js TypeScript registration is idempotent and compatible with the bumped svelte-rune-highlight version.

Possibly related PRs

Poem

🐰
I hopped through imports, quick and sly,
Gathered examples from the sky.
Taught tsLang how to sparkle bright,
Swapped old wrappers for clearer light.
Snippets shine — a rabbit's delight! 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (2 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title mentions 'Button loader, Datepicker range color, example code etc.' but is vague with the catch-all 'etc.' term, making it unclear what all changes are included. Make the title more specific about the main change; avoid 'etc.' and instead list the primary scope (e.g., 'fix: Button loader spinner, Datepicker day button colors, and code highlighting').
Out of Scope Changes check ❓ Inconclusive The PR includes multiple changes beyond the linked issues: Button spinner props, code highlighting refactor, TypeScript page updates, and component file removals/migrations; unclear if these address issue #1839 or are out-of-scope additions.
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The PR description follows the repository template with all required sections: related issues (#1841, #1839), PR type (Bug fix, Documentation), status (Ready for review), and a comprehensive checklist.
Linked Issues check ✅ Passed The PR addresses linked issue #1841 by changing Datepicker day button background from bg--100 to bg--300 in src/lib/datepicker/theme.ts, providing darker backgrounds for better contrast in light mode as required.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Comment @coderabbitai help to get the list of available commands and usage tips.

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

🧹 Nitpick comments (1)
src/routes/docs/pages/typescript.md (1)

29-29: Add error handling for missing or failed file load.

The code assumes examples["../../../lib/types.ts"] exists and is accessible. If the file fails to load or the glob pattern doesn't match, this will pass undefined to HighlightCompo, which may cause runtime errors. Consider adding a fallback or validation.

-<HighlightCompo codeLang={tsLang} code={examples["../../../lib/types.ts"] as string} class="max-w-7xl bg-white"  numberLine/>
+<HighlightCompo codeLang={tsLang} code={examples["../../../lib/types.ts"] as string ?? ""} class="max-w-7xl bg-white" numberLine/>
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7e13d30 and 013c237.

📒 Files selected for processing (1)
  • src/routes/docs/pages/typescript.md (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: Playwright and Lint
🔇 Additional comments (1)
src/routes/docs/pages/typescript.md (1)

14-18: No issues found — Vite syntax is correct.

Vite's import.meta.glob supports the query: '?raw' parameter for loading files as raw text, along with the import: 'default' option used in your code. The implementation follows standard Vite v4 patterns and will correctly load the TypeScript file as raw text.

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 013c237 and a37f44d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • package.json (1 hunks)
  • src/routes/docs/pages/typescript.md (1 hunks)
  • src/routes/utils/HighlightCompo.svelte (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/routes/docs/pages/typescript.md
⏰ 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: Playwright and Lint
🔇 Additional comments (4)
src/routes/utils/HighlightCompo.svelte (3)

7-12: LGTM! Strong type definition.

The HighlightLanguage type provides excellent encapsulation by bundling the language name with its registration function, improving type safety and API clarity.


32-32: LGTM! Proper prop forwarding pattern.

The destructuring correctly implements the new API with language and uses the spread operator to capture remaining props for forwarding, which improves component flexibility.


76-79: LGTM! Improved flexibility and prop forwarding.

The updated logic correctly uses the new language.name property and accepts both "markdown" and "md" for better flexibility. The {...restProps} forwarding ensures all additional props reach the child components.

package.json (1)

95-95: Verify svelte-rune-highlight 0.8.0 availability and breaking changes manually.

Shell script confirmed version 0.8.0 exists on npm registry with no security vulnerabilities, but web sources indicate the latest published version is 0.7.1. Unable to locate changelog or breaking change documentation for 0.8.0. Before merging, confirm:

  • The version 0.8.0 is stable and publicly available (not pre-release)
  • No breaking changes exist in the API used by HighlightCompo
  • Dependencies are compatible with your current setup

wrapLines?: boolean;
startingLineNumber?: number;
highlightedLines?: number[];
backgroudColor?: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix typo in prop name.

The prop name is misspelled as backgroudColor instead of backgroundColor.

Apply this diff to fix the typo:

-    backgroudColor?: string;
+    backgroundColor?: string;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
backgroudColor?: string;
backgroundColor?: string;
🤖 Prompt for AI Agents
In src/routes/utils/HighlightCompo.svelte around line 28, the prop name is
misspelled as "backgroudColor"; rename the prop to "backgroundColor" everywhere
it's declared and referenced (including type annotations, props export, and any
usages within the component and its consumers) to ensure consistency and avoid
runtime/typing errors.

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

📥 Commits

Reviewing files that changed from the base of the PR and between a37f44d and 382f643.

📒 Files selected for processing (1)
  • src/routes/utils/HighlightCompo.svelte (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). (1)
  • GitHub Check: Playwright and Lint
🔇 Additional comments (3)
src/routes/utils/HighlightCompo.svelte (3)

7-12: LGTM! Well-structured type definition.

The HighlightLanguage type provides clear type safety for language configuration and properly integrates with highlight.js's LanguageFn type.


32-32: LGTM! Props destructuring with rest operator.

The destructuring correctly extracts the new language prop and uses ...restProps to capture and forward additional Highlight.js props to child components, maintaining type safety through the Props interface.


76-79: Verify prop precedence: explicit language vs restProps spread.

Line 77 explicitly passes language={mdLang} and then spreads {...restProps}, which also contains language. In JSX/Svelte, props appearing later typically override earlier ones, so restProps.language would override mdLang.

This may not be the intended behavior. Consider either:

  1. Excluding language from restProps before spreading, or
  2. Reversing the order to {...restProps} language={mdLang} to ensure mdLang takes precedence

Apply this diff to fix the prop precedence:

-      {#if ["markdown", "md"].includes(language.name)}
-        <Highlight language={mdLang} code={processedCode} {...restProps} />
+      {#if ["markdown", "md"].includes(language.name)}
+        <Highlight {...restProps} language={mdLang} code={processedCode} />

Or extract language from restProps:

-  let { code, language, badgeClass, buttonClass, replaceLib = true, class: className, ...restProps }: Props = $props();
+  let { code, language, badgeClass, buttonClass, replaceLib = true, class: className, ...restProps }: Props = $props();
+  // Ensure language is not in restProps to avoid conflicts
+  const { language: _, ...propsWithoutLanguage } = { language, ...restProps };

And then use propsWithoutLanguage instead of restProps in the template.

Likely an incorrect or invalid review comment.

badgeClass?: string;
buttonClass?: string;
codeLang?: string;
language: HighlightLanguage;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify all usages have been updated for the breaking API change.

The prop has changed from optional codeLang?: string to required language: HighlightLanguage. According to previous review comments, 18+ component usages in the codebase had not been updated. Please verify all usages now pass the correct language prop.


🏁 Script executed:

#!/bin/bash
# Description: Verify all HighlightCompo usages now use the new language prop

# Search for HighlightCompo component usages
echo "=== HighlightCompo usages ==="
rg -nP --glob='*.svelte' -C3 '<HighlightCompo'

# Search for any remaining references to deprecated codeLang prop
echo -e "\n=== Deprecated codeLang usage ==="
rg -nP --glob='*.svelte' 'codeLang='

# Check for HighlightCompo usages without language prop
echo -e "\n=== Checking for missing language prop ==="
rg -nPU --glob='*.svelte' '<HighlightCompo(?:(?!language=)[^>])*>'

Length of output: 20682


Fix incompatible HighlightCompo usages across the codebase.

The component change to require language: HighlightLanguage has not been fully applied. 20 usages remain incompatible:

  • 6 usages in src/routes/builder/skeleton/+page.svelte (lines 142, 159, 174, 189, 200, 229): missing language prop entirely
  • 13 usages in src/routes/docs-examples/extend/clipboard-manager/+page.svelte (lines 28, 42, 61, 79, 99, 119, 133, 172, 189, 202, 216, 233, 247): still using deprecated codeLang prop
  • 1 usage in src/routes/admin-dashboard/(sidebar)/quickstart/+page.svelte (line 21): still using deprecated codeLang prop

Update all instances to pass the new language prop with a valid HighlightLanguage value.

🤖 Prompt for AI Agents
In src/routes/utils/HighlightCompo.svelte around line 18 the prop signature was
changed to require language: HighlightLanguage; but many call sites still omit
it or use deprecated codeLang; update all listed usages to pass the new language
prop with a valid HighlightLanguage value: in
src/routes/builder/skeleton/+page.svelte (lines 142, 159, 174, 189, 200, 229)
add language="..." appropriate to the snippet; in
src/routes/docs-examples/extend/clipboard-manager/+page.svelte (lines 28, 42,
61, 79, 99, 119, 133, 172, 189, 202, 216, 233, 247) replace codeLang={...} with
language={...} using the correct HighlightLanguage enum/value; and in
src/routes/admin-dashboard/(sidebar)/quickstart/+page.svelte (line 21) likewise
replace codeLang with language; ensure values are valid HighlightLanguage
entries and run typecheck to confirm no remaining incompatibilities.

@shinokada shinokada changed the title fix: typescript page update 2 fix: Button loader, Datepicker range color, example code etc. Nov 17, 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: 2

🧹 Nitpick comments (3)
src/lib/types.ts (1)

627-627: Consider consistent formatting for empty interfaces.

Several empty interface definitions have whitespace-only changes. For consistency and readability, consider either keeping them on a single line or using a consistent multi-line format across the codebase.

Also applies to: 786-786, 982-982, 1171-1171, 1488-1488, 1498-1498, 1899-1899

src/lib/buttons/Button.svelte (2)

12-12: Consider consistent spacing in object literal.

The default value {size:"4"} lacks spacing around the colon. For consistency with typical JavaScript style, consider { size: "4" }.

Apply this diff:

-  let { children, pill, outline = false, size = "md", color, shadow = false, tag = "button", disabled, loading = false, spinnerProps = {size:"4"}, class: className, ...restProps }: ButtonProps = $props();
+  let { children, pill, outline = false, size = "md", color, shadow = false, tag = "button", disabled, loading = false, spinnerProps = { size: "4" }, class: className, ...restProps }: ButtonProps = $props();

42-59: Add spinnerProps to the props documentation.

The component documentation block is missing the newly added spinnerProps prop.

Add after line 56:

 @prop disabled
 @prop loading = false
+@prop spinnerProps = { size: "4" }
 @prop class: className
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 382f643 and 387b5e5.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (13)
  • package.json (1 hunks)
  • src/lib/buttons/Button.svelte (2 hunks)
  • src/lib/buttons/theme.ts (1 hunks)
  • src/lib/datepicker/theme.ts (1 hunks)
  • src/lib/types.ts (8 hunks)
  • src/routes/admin-dashboard/(sidebar)/quickstart/+page.svelte (2 hunks)
  • src/routes/builder/skeleton/+page.svelte (1 hunks)
  • src/routes/docs-examples/components/buttons/Loader.svelte (1 hunks)
  • src/routes/docs-examples/components/datepicker/Range.svelte (1 hunks)
  • src/routes/docs-examples/extend/clipboard-manager/+page.svelte (14 hunks)
  • src/routes/docs/pages/typescript.md (1 hunks)
  • src/routes/utils/HighlightCompo.svelte (0 hunks)
  • src/routes/utils/theme.ts (0 hunks)
💤 Files with no reviewable changes (2)
  • src/routes/utils/theme.ts
  • src/routes/utils/HighlightCompo.svelte
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json
🧰 Additional context used
🧠 Learnings (6)
📚 Learning: 2024-11-22T08:37:27.996Z
Learnt from: mrh1997
Repo: themesberg/flowbite-svelte PR: 1442
File: src/lib/utils/Popper.svelte:144-145
Timestamp: 2024-11-22T08:37:27.996Z
Learning: In `src/lib/utils/Popper.svelte`, inconsistencies in event handling (e.g., using both `mouseenter`/`mouseleave` and `pointerenter`/`pointerleave`) may be intentional to minimize modifications and reduce the risk of new problems.

Applied to files:

  • src/lib/buttons/Button.svelte
📚 Learning: 2024-10-18T09:38:03.879Z
Learnt from: Chizaruu
Repo: themesberg/flowbite-svelte PR: 1465
File: src/lib/forms/Timepicker.svelte:105-116
Timestamp: 2024-10-18T09:38:03.879Z
Learning: In `Timepicker.svelte`, the `Dropdown` opens as intended and is used exclusively with the 'dropdown' and 'timerange-dropdown' Timepicker types.

Applied to files:

  • src/routes/docs-examples/components/datepicker/Range.svelte
📚 Learning: 2024-10-15T22:41:47.429Z
Learnt from: Chizaruu
Repo: themesberg/flowbite-svelte PR: 1464
File: src/routes/component-data/Datepicker.json:0-0
Timestamp: 2024-10-15T22:41:47.429Z
Learning: The component should be named 'Datepicker' (with lowercase 'p') throughout the codebase to maintain consistency.

Applied to files:

  • src/routes/docs-examples/components/datepicker/Range.svelte
📚 Learning: 2025-03-20T12:47:33.307Z
Learnt from: superstes
Repo: themesberg/flowbite-svelte PR: 0
File: :0-0
Timestamp: 2025-03-20T12:47:33.307Z
Learning: In the Flowbite Svelte library's composite form components like MultiInput, when implementing focus styles with focus-within, create a dedicated focusWithinClasses object with appropriate colors for each state (base, primary, green, red). Using just 'focus-within:ring-1' without color specification won't correctly apply color-specific styling when the input receives focus directly.

Applied to files:

  • src/lib/datepicker/theme.ts
📚 Learning: 2025-03-20T11:52:09.106Z
Learnt from: superstes
Repo: themesberg/flowbite-svelte PR: 0
File: :0-0
Timestamp: 2025-03-20T11:52:09.106Z
Learning: In the Flowbite Svelte library's form components, both the regular focus styling (controlled by ringClasses) and focus-within styling need to be dynamically adjusted based on validation state. For proper validation styling, create separate objects for focus-within classes (like focusWithinClasses) that use the same color as ringClasses when inputInvalid=true.

Applied to files:

  • src/lib/datepicker/theme.ts
📚 Learning: 2025-03-20T11:52:09.106Z
Learnt from: superstes
Repo: themesberg/flowbite-svelte PR: 0
File: :0-0
Timestamp: 2025-03-20T11:52:09.106Z
Learning: In the Flowbite Svelte library's form components like MultiInput, when handling focus states for validation, avoid hardcoding focus-within classes like 'focus-within:border-primary-500'. Instead, create a dynamic mapping object (e.g., focusWithinClasses) that changes the focus ring color based on the current color state, especially when inputInvalid=true.

Applied to files:

  • src/lib/datepicker/theme.ts
🧬 Code graph analysis (1)
src/lib/types.ts (5)
src/lib/drawer/theme.ts (1)
  • DrawerHandleVariants (78-78)
src/lib/forms/helper/theme.ts (1)
  • HelperVariants (4-4)
src/lib/toolbar/theme.ts (1)
  • ToolbarGroupVariants (6-6)
src/lib/skeleton/theme.ts (2)
  • TestimonialPlaceholderVariants (9-9)
  • WidgetPlaceholderVariants (12-12)
src/lib/tooltip/theme.ts (1)
  • TooltipVariants (4-4)
⏰ 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: Playwright and Lint
🔇 Additional comments (13)
src/lib/datepicker/theme.ts (1)

25-47: LGTM! Consistent theming update across all color variants.

The dayButton background colors have been uniformly updated from lighter shades (e.g., bg-*-100) to mid-range shades (bg-*-300 for light mode, bg-*-900 for dark mode) across all 23 color variants. This provides better visual contrast and consistency for selected dates.

src/routes/docs-examples/components/datepicker/Range.svelte (1)

11-11: LGTM! Example color update.

The color change from "pink" to "blue" aligns with the datepicker theming updates and provides a standard color variant for the range example.

src/routes/docs-examples/components/buttons/Loader.svelte (1)

5-10: LGTM! Clear examples of the new loading button functionality.

The new examples effectively demonstrate:

  • Basic loading state (lines 5-7)
  • Customized spinner with size and color props (lines 8-10)

These examples align with the spinnerProps addition to ButtonProps in types.ts and provide clear documentation for developers.

src/routes/builder/skeleton/+page.svelte (1)

23-23: LGTM! Consistent migration to external highlighting package.

The import change from the local HighlightCompo component to svelte-rune-highlight is consistent with the broader migration across the codebase (also seen in quickstart and typescript pages). The component usages throughout the file remain compatible with the external package's API.

src/lib/buttons/theme.ts (1)

11-12: LGTM! Proper theme slot addition for spinner support.

The new spinner slot with "ms-2" (margin-start) class provides appropriate spacing for the spinner component within buttons. This change properly extends the button theme to support the spinnerProps functionality added to ButtonProps.

src/routes/docs/pages/typescript.md (2)

30-30: Clean migration to external highlighting component.

The HighlightCompo usage properly integrates the TypeScript language registration and dynamically loaded code content. The removal of the undefined numberLine prop (mentioned in past reviews) and the switch to the language prop represents a clean migration to the external svelte-rune-highlight package, pending verification of the API compatibility.


12-23: The code is correct and requires no changes.

The language prop expects an object with a name string and a register function, which matches the implementation at lines 20-23: { name: 'typescript', register: typescript }. The code properly follows the documented API.

src/lib/buttons/Button.svelte (2)

20-20: LGTM!

The spinner property is correctly extracted from the button theme and aligns with the new Spinner component integration.


30-35: LGTM!

The Spinner component is correctly integrated with proper conditional rendering and theme application. The use of spread props allows flexible customization via spinnerProps.

src/routes/docs-examples/extend/clipboard-manager/+page.svelte (4)

2-3: LGTM!

The migration to svelte-rune-highlight package aligns with the broader codebase refactoring to adopt external highlighting utilities.


8-21: LGTM!

The eager glob imports with proper type assertions enable a clean data-driven approach. Using transformComponents and transformModules helpers should provide normalized keys for consistent component and code access.


32-201: LGTM!

The ExampleWrapper components are used consistently throughout with proper component and code prop bindings. This data-driven approach significantly improves maintainability compared to static per-example blocks.


44-44: Update line 44 to use transformed modules for consistency.

All other example renderings use the transformed modules object (with simplified keys like 'Interactive', 'TargetSpecific'), but line 44 directly accesses exampleModules with the raw path "./examples/EnableSelectionMenu.svelte". This inconsistency should be resolved:

       <HighlightCompo code={modules['EnableSelectionMenu']} class="max-w-7xl bg-white" />

Ensure the transformed module key matches the filename (without path/extension).

⛔ Skipped due to learnings
Learnt from: mrh1997
Repo: themesberg/flowbite-svelte PR: 1442
File: src/lib/utils/Popper.svelte:144-145
Timestamp: 2024-11-22T08:37:27.996Z
Learning: In `src/lib/utils/Popper.svelte`, inconsistencies in event handling (e.g., using both `mouseenter`/`mouseleave` and `pointerenter`/`pointerleave`) may be intentional to minimize modifications and reduce the risk of new problems.

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

🧹 Nitpick comments (2)
src/routes/docs-examples/extend/clipboard-manager/+page.svelte (2)

44-45: Consider reusing modules['EnableSelectionMenu'] instead of raw exampleModules

For the “Enable Selection Menu” snippet you still reference the raw glob map (exampleModules["./examples/EnableSelectionMenu.svelte"]) while other examples use the transformed modules map. Functionally this is fine, but for consistency and future refactors it might be cleaner to rely on modules['EnableSelectionMenu'] here as well (assuming transformModules exposes that key).

If transformModules already exposes an EnableSelectionMenu entry, a refactor would look like:

-  <HighlightCompo code={exampleModules["./examples/EnableSelectionMenu.svelte"] as string} class="max-w-7xl bg-white" />
+  <HighlightCompo code={modules['EnableSelectionMenu']} class="max-w-7xl bg-white" />

23-24: Rename sentitiveEx for clarity; HighlightCompo usage looks fine

The inline example for detectSensitiveData is helpful, but the variable name sentitiveEx is likely a typo and slightly hurts readability. Renaming it to sensitiveEx (or similar) keeps things clearer; the HighlightCompo usage with a plain string code prop is otherwise straightforward.

Suggested tweak:

-  const sentitiveEx = "detectSensitiveData=(text) => (/confidential|secret/i).test(text)";
+  const sensitiveEx = "detectSensitiveData=(text) => (/confidential|secret/i).test(text)";-      <HighlightCompo code={sentitiveEx} class="my-2 max-w-7xl bg-white" />
+      <HighlightCompo code={sensitiveEx} class="my-2 max-w-7xl bg-white" />

Please just confirm in the svelte-rune-highlight docs that the code prop is still the recommended way to pass a literal string snippet.

Also applies to: 160-161

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5779ea5 and d7f5c38.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • package.json (1 hunks)
  • src/routes/docs-examples/extend/clipboard-manager/+page.svelte (14 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json
⏰ 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: Playwright and Lint
🔇 Additional comments (1)
src/routes/docs-examples/extend/clipboard-manager/+page.svelte (1)

32-32: Key naming verified—all ExampleWrapper usages are correct

The transformComponents and transformModules functions use defaultPathToName to extract component names from glob paths, converting './examples/Interactive.svelte' to 'Interactive'. All 11 ExampleWrapper usages at the specified lines use keys that match actual .svelte files in the examples directory:

  • Interactive ✓
  • TargetSpecific ✓
  • WithModal ✓
  • DocumentationSite ✓
  • BlogReader ✓
  • EmailClient ✓
  • SaveToStorage ✓
  • CodeEditor ✓
  • MultipleContent ✓
  • NoManualInput ✓
  • CustomEmptyState ✓

No runtime key mismatches will occur.

@jjagielka jjagielka mentioned this pull request Nov 17, 2025
16 tasks
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)
src/routes/docs-examples/extend/clipboard-manager/+page.svelte (1)

44-44: Consider refining the transformModules return type.

The as string type assertion suggests transformModules may return a loosely typed result. If you control the transformModules function, consider having it return Record<string, string> to eliminate the need for assertions at call sites.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d7f5c38 and 245840c.

📒 Files selected for processing (1)
  • src/routes/docs-examples/extend/clipboard-manager/+page.svelte (14 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-11-22T08:37:27.996Z
Learnt from: mrh1997
Repo: themesberg/flowbite-svelte PR: 1442
File: src/lib/utils/Popper.svelte:144-145
Timestamp: 2024-11-22T08:37:27.996Z
Learning: In `src/lib/utils/Popper.svelte`, inconsistencies in event handling (e.g., using both `mouseenter`/`mouseleave` and `pointerenter`/`pointerleave`) may be intentional to minimize modifications and reduce the risk of new problems.

Applied to files:

  • src/routes/docs-examples/extend/clipboard-manager/+page.svelte
⏰ 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: Playwright and Lint
🔇 Additional comments (4)
src/routes/docs-examples/extend/clipboard-manager/+page.svelte (4)

8-21: LGTM: Glob setup and transforms follow the intended pattern.

The eager loading of both component modules and raw source, followed by transformation, is appropriate for a documentation page where all examples should be immediately available. The type assertions are necessary for Vite's glob import typing.


23-23: LGTM: Typo fixed.

The variable name is now correctly spelled sensitiveEx (previously sentitiveEx per past review comments).


32-201: LGTM: Consistent usage of transformed component and module maps.

All examples now consistently reference the transformed components and modules maps throughout the file. The mix of ExampleWrapper (for interactive demos with source) and standalone HighlightCompo (for code snippets like sensitiveEx) is appropriate for the different presentation contexts.


2-2: All imports are valid exports from svelte-rune-highlight.

Verification confirms that ExampleWrapper, HighlightCompo, transformComponents, and transformModules are all properly exported from the package (confirmed in dist/index.d.ts). No runtime import errors will occur.

@shinokada shinokada merged commit 771cf9d into themesberg:main Nov 17, 2025
1 of 2 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.

Text is hard to read in light mode for DatePicker range

1 participant