Skip to content

feat(examples): next-chakra-v3 host reproduction#614

Merged
Agilulfo1820 merged 2 commits into
mainfrom
feat/chakra-v3-repro-example
May 15, 2026
Merged

feat(examples): next-chakra-v3 host reproduction#614
Agilulfo1820 merged 2 commits into
mainfrom
feat/chakra-v3-repro-example

Conversation

@Agilulfo1820

@Agilulfo1820 Agilulfo1820 commented May 14, 2026

Copy link
Copy Markdown
Member

Summary

Adds examples/next-chakra-v3/ — a workspace-linked example that mirrors b3tr's frontend stack (Next.js App Router + React 18 + Chakra UI v3 + next-themes). Wires the same useColorMode / useToken patterns that b3tr uses around VeChainKitProvider so we can reproduce and debug host-integration edge cases against the local kit sources without needing to publish new releases.

Why

Caught a real bug only reproducible against this stack: Chakra v3's useToken('colors', 'bg.primary') returns the resolved literal value at render time (e.g. #1B1D1F) rather than a CSS variable reference. When that snapshot is piped into the kit's theme prop the kit's modal / card / sticky-header surfaces lock to whichever mode Chakra evaluated first and stop tracking next-themes' html.class toggles. The existing Chakra v2 playground can't surface this because useToken v2 returns a var(...) reference by default.

The publish-test loop made every iteration expensive. With this example linked to the workspace, edits in packages/vechain-kit/src flow through to a running yarn dev:next-chakra-v3 instantly, and Playwright probes against http://localhost:3010 can verify computed CSS variables and rendered colors programmatically.

Companion docs PRs:

  • vechain/vechain-kit-docs#… adds a troubleshooting page about the useToken snapshot pitfall
  • vechain/vechain-ai-skills#… notes the same gotcha in the kit-theming reference

What

  • examples/next-chakra-v3/ — Chakra v3 + next-themes shell with connect / account modal triggers, theme toggle, and a host-rendered comparison card sharing the same semantic tokens piped into the kit's theme prop
  • dev:next-chakra-v3 root script runs the kit's watch + the example's dev server in parallel
  • .gitignore covers node_modules, .next, .turbo, dist, next-env.d.ts, .env*
  • Inline comment in the example wrapper documents the sys.token.var(...) workaround so future devs don't repeat the mistake

Test plan

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced a new example application showcasing Chakra UI v3 integration with dynamic color theme switching, wallet connection management, and connected wallet information display.
  • Documentation

    • Added setup and usage documentation for the new example.
  • Chores

    • Standardized Next.js versions to ~16.2.3 across example projects.

Review Change Stack

Agilulfo1820 and others added 2 commits May 14, 2026 19:26
Adds a workspace-linked example that mirrors b3tr's stack — Next.js (App
Router) + React 18 + Chakra UI v3 + next-themes — driving the kit via the
same `useColorMode` / `useToken` patterns the production app uses.

Lets us reproduce and debug host integration edge cases (notably the
Chakra v3 `useToken` value-vs-var-ref pitfall) against the local kit
sources without needing to publish new releases. Run with
`yarn dev:next-chakra-v3` (kit watch + example dev on :3010).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented May 14, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR adds a complete next-chakra-v3 example demonstrating Chakra UI v3 semantic token propagation to the VeChain kit with color-mode switching, updates Next.js to ~16.2.3 across existing examples for consistency, and integrates the example into workspace tooling for development.

Changes

next-chakra-v3 Example and Dependency Updates

Layer / File(s) Summary
Next.js version updates across examples
examples/homepage/package.json, examples/next-template/package.json, examples/playground/package.json
Next.js dependency pinned to ~16.2.3 across three example projects for version consistency.
next-chakra-v3 project setup and configuration
examples/next-chakra-v3/package.json, examples/next-chakra-v3/next.config.js, examples/next-chakra-v3/tsconfig.json, examples/next-chakra-v3/.gitignore, examples/next-chakra-v3/README.md
Project infrastructure including dependencies (Chakra, next-themes, Vechain kit), build scripts, Next.js configuration with package import optimization, TypeScript config with path aliases, standard ignores, and documentation of theming/kit integration patterns.
Chakra v3 theme system and semantic tokens
examples/next-chakra-v3/src/theme/theme.ts
Chakra theme with cssVarsPrefix, base color tokens, and semantic variants (background, actions, cards, borders, text) with dark mode CSS variable references; global styles render theme-aware root element.
Color mode provider and hooks
examples/next-chakra-v3/src/components/ui/color-mode.tsx
ColorModeProvider wraps next-themes ThemeProvider; useColorMode hook derives active mode and provides toggle/setColorMode API; ColorModeIcon and ColorModeButton components render theme toggle UI.
UI Provider composition
examples/next-chakra-v3/src/components/ui/provider.tsx, examples/next-chakra-v3/src/app/layout.tsx, examples/next-chakra-v3/src/app/providers.tsx
Provider component wraps ChakraProvider with theme and ColorModeProvider; root layout exports metadata and renders Providers around children; Providers component dynamically loads VechainKitProviderWrapper with SSR disabled.
VeChain kit provider wrapper with token sync
examples/next-chakra-v3/src/providers/VechainKitProviderWrapper.tsx
Dynamically wraps VeChainKitProvider; reads Chakra semantic token CSS variable references via useChakraContext() and builds reactive theme object for modals/buttons; configures Privy app/client IDs, WalletConnect metadata, login methods, and applies dark mode from color mode state.
Example page demonstrating theme integration
examples/next-chakra-v3/src/app/page.tsx
Page component displays current color mode, wallet connection state, and shortened account address with source type; includes card explaining that Chakra v3 semantic tokens propagate to kit theme; provides connect/account modals with theme-aware styling.
Workspace integration for example development
package.json
Adds dev:next-chakra-v3 script to run kit watcher and example dev server in parallel for workspace-linked hot-reload.

🐰 A theme so fine, with tokens that shine,
Chakra and kit in harmony align,
Dark mode dances, light takes its place,
Next.js steps forward with style and grace!

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(examples): next-chakra-v3 host reproduction' accurately describes the main change: adding a new next-chakra-v3 example to reproduce host integration issues with Chakra UI v3.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/chakra-v3-repro-example

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🧹 Nitpick comments (5)
examples/next-chakra-v3/src/components/ui/color-mode.tsx (2)

19-19: 💤 Low value

Consider removing the empty interface.

The interface doesn't add any new properties beyond ThemeProviderProps. While this might be for future extensibility, it currently adds no value.

♻️ Simplify by using the base type directly
-export interface ColorModeProviderProps extends ThemeProviderProps {}
-export function ColorModeProvider(props: ColorModeProviderProps) {
+export function ColorModeProvider(props: ThemeProviderProps) {
     return (
         <ThemeProvider attribute="class" disableTransitionOnChange {...props} />
     );
 }

As per coding guidelines (static analysis): An interface declaring no members is equivalent to its supertype.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/next-chakra-v3/src/components/ui/color-mode.tsx` at line 19, Remove
the redundant empty interface ColorModeProviderProps that merely extends
ThemeProviderProps; instead use ThemeProviderProps directly wherever
ColorModeProviderProps is referenced (e.g., props typing for ColorModeProvider
or any function/component signatures), or delete the type alias and update
imports/usages to refer to ThemeProviderProps to keep typings identical and
remove unnecessary indirection.

51-51: 💤 Low value

Consider removing the empty interface.

Similar to line 19, this interface adds no properties beyond what it extends.

♻️ Simplify by inlining the type
-interface ColorModeButtonProps extends Omit<IconButtonProps, 'aria-label'> {}
-
 export const ColorModeButton = React.forwardRef<
     HTMLButtonElement,
-    ColorModeButtonProps
+    Omit<IconButtonProps, 'aria-label'>
 >(function ColorModeButton(props, ref) {

As per coding guidelines (static analysis): An interface declaring no members is equivalent to its supertype.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/next-chakra-v3/src/components/ui/color-mode.tsx` at line 51, The
empty interface ColorModeButtonProps that extends Omit<IconButtonProps,
'aria-label'> is redundant; remove the interface declaration and replace
references to ColorModeButtonProps with the inlined type Omit<IconButtonProps,
'aria-label'> (e.g., update the ColorModeButton component props signature and
any usages to use Omit<IconButtonProps, 'aria-label'> directly).
examples/next-chakra-v3/src/providers/VechainKitProviderWrapper.tsx (3)

36-37: ⚡ Quick win

Type assertion may be unsafe.

The as string assertion assumes sys.token.var() always returns a string, but if the token path is invalid, it might return undefined. Consider adding validation or using a more defensive type guard.

🛡️ Add validation for token variables
     const sys = useChakraContext();
-    const tokVar = (path: string) =>
-        sys.token.var(`colors.${path}`) as string;
+    const tokVar = (path: string): string => {
+        const value = sys.token.var(`colors.${path}`);
+        if (!value) {
+            console.warn(`Missing Chakra token: colors.${path}`);
+            return `var(--fallback-color)`;
+        }
+        return value as string;
+    };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/next-chakra-v3/src/providers/VechainKitProviderWrapper.tsx` around
lines 36 - 37, The helper tokVar currently asserts
sys.token.var(`colors.${path}`) as string which can be undefined; update tokVar
to check the result of sys.token.var(`colors.${path}`) at runtime and handle
non-string/undefined values—either return a safe default, throw a clear error,
or narrow the type before returning. Locate tokVar and replace the blind cast
with a guard that verifies typeof value === "string" (or uses a provided
default/fallback) so callers get a guaranteed string or an explicit failure.

45-48: 💤 Low value

Consider removing the void statement.

The void useToken; statement is unusual. While the comment explains this is intentional, keeping an unused import just for documentation purposes adds confusion. Consider removing the import and updating the comment to reference the hook name as a string instead.

♻️ Remove the unused import
-import { useChakraContext, useToken } from '@chakra-ui/react';
+import { useChakraContext } from '@chakra-ui/react';

Update the comment at lines 29-34 to reference useToken as text without importing it.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/next-chakra-v3/src/providers/VechainKitProviderWrapper.tsx` around
lines 45 - 48, Remove the odd no-op "void useToken;" and the corresponding
import of useToken; instead update the comment that currently references
useToken by keeping the hook name as plain text (e.g., "useToken") to document
the broken path without importing it; ensure any import list and top-of-file
imports remove useToken so there are no unused imports or no-op statements left
in VechainKitProviderWrapper.tsx and that the comment clearly states the hook
name as a string.

73-100: 💤 Low value

Hardcoded credentials present in example code.

The file contains hardcoded Privy and WalletConnect credentials with environment variable fallbacks. While this pattern is acceptable for example/demo code to ensure it runs out-of-the-box, consider adding a comment warning developers to replace these with their own credentials in production applications.

📝 Add warning comment
         privy={{
+            // NOTE: Replace these demo credentials with your own in production
             appId:
                 process.env.NEXT_PUBLIC_PRIVY_APP_ID ||
                 'cm4wxxujb022fyujl7g0thb21',
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/next-chakra-v3/src/providers/VechainKitProviderWrapper.tsx` around
lines 73 - 100, The example embeds hardcoded Privy and WalletConnect credentials
inside the VechainKitProviderWrapper dappKit and privy config blocks (appId,
clientId, walletConnectOptions.projectId); add a clear top-line comment
immediately above these default fallbacks warning that these are example/demo
credentials and must be replaced with real environment-provided values in
production, and recommend using only process.env variables (remove or
de-emphasize the hardcoded secrets) so developers know to supply
NEXT_PUBLIC_PRIVY_APP_ID, NEXT_PUBLIC_PRIVY_CLIENT_ID and
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID for production.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@examples/homepage/package.json`:
- Line 21: The package.json lists "next": "~16.2.3" which requires React 19.2+,
but the file currently pins React to ^18; fix by making the dependencies
compatible: either update the "react" and "react-dom" entries to ^19.2.0 (and
verify any peer changes) when keeping "next" at ~16.2.3, or change "next" to a
15.x release (e.g., ^15.0.0) that supports React 18; update package.json
accordingly and run install/test to confirm no peer conflicts.

In `@examples/next-chakra-v3/README.md`:
- Around line 32-34: Update the README sentence that currently reads "The
example serves on http://localhost:3001." to the correct local URL
"http://localhost:3010." Locate the line in examples/next-chakra-v3/README.md
containing that sentence and replace the port number 3001 with 3010 so the
documented local URL matches the actual dev server.
- Around line 16-19: The README's description of VechainKitProviderWrapper is
inaccurate: update the sentence that references useToken('colors', [...]) to
state that Chakra v3's useToken returns resolved token values (actual color
strings like "#ffffff" or "rgb(...)"), not CSS variable references such as
var(--vbd-colors-bg-primary); keep the rest of the note about piping those
values into the kit's theme prop and passing darkMode={colorMode === 'dark'}
unchanged and reference VechainKitProviderWrapper and useToken so the intent and
repro are clear.

In `@examples/next-chakra-v3/src/components/ui/color-mode.tsx`:
- Around line 36-38: The toggleColorMode currently inspects resolvedTheme only,
ignoring the computed colorMode (forcedTheme || resolvedTheme) and causing
inconsistent behavior when a theme is forced; update the toggleColorMode
function to use the computed colorMode variable (the one derived from
forcedTheme || resolvedTheme) to decide the new theme, e.g., compute newTheme =
colorMode === 'dark' ? 'light' : 'dark' and call setTheme(newTheme) so toggling
respects forcedTheme when present.

In `@examples/next-chakra-v3/src/providers/VechainKitProviderWrapper.tsx`:
- Around line 42-43: secondaryHover is using an incorrect semantic token path so
tokVar('card.hover') returns undefined; update the reference in
VechainKitProviderWrapper where secondaryDefault and secondaryHover are set so
that secondaryHover uses the correct token path tokVar('card.subtle.hover')
(keep secondaryDefault as tokVar('card.subtle')) to match the theme's
card.subtle.hover token.

In `@examples/playground/package.json`:
- Line 21: The Next.js dependency "next": "~16.2.3" requires Node.js >=20.9.0
but our project uses Node 18; update project configuration to require Node
20.9.0+ by adding or updating the package.json "engines" field to "node":
">=20.9.0" (or add an .nvmrc with 20.9.0 or later) and ensure CI/deployment
configs (e.g., any Dockerfile, GitHub Actions runners, or build images) are set
to use Node 20.9.0+ so builds and dev environments match the requirement.

---

Nitpick comments:
In `@examples/next-chakra-v3/src/components/ui/color-mode.tsx`:
- Line 19: Remove the redundant empty interface ColorModeProviderProps that
merely extends ThemeProviderProps; instead use ThemeProviderProps directly
wherever ColorModeProviderProps is referenced (e.g., props typing for
ColorModeProvider or any function/component signatures), or delete the type
alias and update imports/usages to refer to ThemeProviderProps to keep typings
identical and remove unnecessary indirection.
- Line 51: The empty interface ColorModeButtonProps that extends
Omit<IconButtonProps, 'aria-label'> is redundant; remove the interface
declaration and replace references to ColorModeButtonProps with the inlined type
Omit<IconButtonProps, 'aria-label'> (e.g., update the ColorModeButton component
props signature and any usages to use Omit<IconButtonProps, 'aria-label'>
directly).

In `@examples/next-chakra-v3/src/providers/VechainKitProviderWrapper.tsx`:
- Around line 36-37: The helper tokVar currently asserts
sys.token.var(`colors.${path}`) as string which can be undefined; update tokVar
to check the result of sys.token.var(`colors.${path}`) at runtime and handle
non-string/undefined values—either return a safe default, throw a clear error,
or narrow the type before returning. Locate tokVar and replace the blind cast
with a guard that verifies typeof value === "string" (or uses a provided
default/fallback) so callers get a guaranteed string or an explicit failure.
- Around line 45-48: Remove the odd no-op "void useToken;" and the corresponding
import of useToken; instead update the comment that currently references
useToken by keeping the hook name as plain text (e.g., "useToken") to document
the broken path without importing it; ensure any import list and top-of-file
imports remove useToken so there are no unused imports or no-op statements left
in VechainKitProviderWrapper.tsx and that the comment clearly states the hook
name as a string.
- Around line 73-100: The example embeds hardcoded Privy and WalletConnect
credentials inside the VechainKitProviderWrapper dappKit and privy config blocks
(appId, clientId, walletConnectOptions.projectId); add a clear top-line comment
immediately above these default fallbacks warning that these are example/demo
credentials and must be replaced with real environment-provided values in
production, and recommend using only process.env variables (remove or
de-emphasize the hardcoded secrets) so developers know to supply
NEXT_PUBLIC_PRIVY_APP_ID, NEXT_PUBLIC_PRIVY_CLIENT_ID and
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID for production.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 62192511-e520-4545-a9d8-d6ef6260b736

📥 Commits

Reviewing files that changed from the base of the PR and between e46358b and ffcb42e.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (16)
  • examples/homepage/package.json
  • examples/next-chakra-v3/.gitignore
  • examples/next-chakra-v3/README.md
  • examples/next-chakra-v3/next.config.js
  • examples/next-chakra-v3/package.json
  • examples/next-chakra-v3/src/app/layout.tsx
  • examples/next-chakra-v3/src/app/page.tsx
  • examples/next-chakra-v3/src/app/providers.tsx
  • examples/next-chakra-v3/src/components/ui/color-mode.tsx
  • examples/next-chakra-v3/src/components/ui/provider.tsx
  • examples/next-chakra-v3/src/providers/VechainKitProviderWrapper.tsx
  • examples/next-chakra-v3/src/theme/theme.ts
  • examples/next-chakra-v3/tsconfig.json
  • examples/next-template/package.json
  • examples/playground/package.json
  • package.json

"i18next": "^24.2.1",
"i18next-browser-languagedetector": "^8.0.2",
"next": ">=15.2.3",
"next": "~16.2.3",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

Does Next.js version 16.2.3 exist and what are its requirements?

💡 Result:

Yes, Next.js version 16.2.3 exists. It was released on April 8, 2026 [1][2]. This is a patch release backporting security and bug fixes, including fixes for ISR revalidation errors, HMR issues with manifest.ts, deduplication of output assets, styled-jsx race conditions, and Turbopack stability improvements [1]. The latest version as of May 14, 2026, is 16.2.6 [3][4]. Its requirements are the same as Next.js 16: Node.js 20.9.0 or higher (Node.js 18 no longer supported) [5], TypeScript 5.1.0 or higher [5], and browser support for Chrome 111+, Edge 111+, Firefox 111+, Safari 16.4+ [5]. It requires React 19.2 or compatible [5].

Citations:


🏁 Script executed:

#!/bin/bash
# Description: Check npm registry for Next.js 16.2.3 availability

# Check if version 16.2.3 exists on npm
curl -s https://registry.npmjs.org/next | jq '.versions["16.2.3"]' | head -20

Repository: vechain/vechain-kit

Length of output: 369


Next.js 16.2.3 requires React 19.2 or compatible, but this example uses React 18.

Next.js 16.2.3 exists and was released April 8, 2026, but it requires React 19.2 or later. The current example specifies React ^18, which will cause incompatibility. Either upgrade React to 19.2+ or downgrade Next.js to a 15.x version compatible with React 18.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/homepage/package.json` at line 21, The package.json lists "next":
"~16.2.3" which requires React 19.2+, but the file currently pins React to ^18;
fix by making the dependencies compatible: either update the "react" and
"react-dom" entries to ^19.2.0 (and verify any peer changes) when keeping "next"
at ~16.2.3, or change "next" to a 15.x release (e.g., ^15.0.0) that supports
React 18; update package.json accordingly and run install/test to confirm no
peer conflicts.

Comment on lines +16 to +19
- A `VechainKitProviderWrapper` that pipes `useToken('colors', [...])`
results — which Chakra v3 returns as CSS variable references like
`var(--vbd-colors-bg-primary)` — straight into the kit's `theme` prop and
passes `darkMode={colorMode === 'dark'}`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Correct the token-behavior description to match the repro case.

This text currently describes useToken output as CSS var references, which conflicts with the Chakra v3 pitfall this example is meant to reproduce/document.

📝 Suggested README edit
-- A `VechainKitProviderWrapper` that pipes `useToken('colors', [...])`
-  results — which Chakra v3 returns as CSS variable references like
-  `var(--vbd-colors-bg-primary)` — straight into the kit's `theme` prop and
-  passes `darkMode={colorMode === 'dark'}`
+- A `VechainKitProviderWrapper` that avoids piping resolved `useToken('colors', [...])`
+  snapshots into the kit `theme` prop; instead it uses Chakra token CSS variable
+  references (e.g. via `sys.token.var(...)`) so kit surfaces keep tracking
+  `next-themes` class toggles in real time, while still passing
+  `darkMode={colorMode === 'dark'}`
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/next-chakra-v3/README.md` around lines 16 - 19, The README's
description of VechainKitProviderWrapper is inaccurate: update the sentence that
references useToken('colors', [...]) to state that Chakra v3's useToken returns
resolved token values (actual color strings like "#ffffff" or "rgb(...)"), not
CSS variable references such as var(--vbd-colors-bg-primary); keep the rest of
the note about piping those values into the kit's theme prop and passing
darkMode={colorMode === 'dark'} unchanged and reference
VechainKitProviderWrapper and useToken so the intent and repro are clear.

Comment on lines +32 to +34
The example serves on http://localhost:3001. Click the sun/moon icon to
toggle `next-themes`; open the connect modal to inspect kit theme
propagation.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix the documented local URL.

The README points to http://localhost:3001, but this example runs on port 3010.

📝 Suggested README edit
-The example serves on http://localhost:3001. Click the sun/moon icon to
+The example serves on http://localhost:3010. Click the sun/moon icon to
 toggle `next-themes`; open the connect modal to inspect kit theme
 propagation.
📝 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
The example serves on http://localhost:3001. Click the sun/moon icon to
toggle `next-themes`; open the connect modal to inspect kit theme
propagation.
The example serves on http://localhost:3010. Click the sun/moon icon to
toggle `next-themes`; open the connect modal to inspect kit theme
propagation.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/next-chakra-v3/README.md` around lines 32 - 34, Update the README
sentence that currently reads "The example serves on http://localhost:3001." to
the correct local URL "http://localhost:3010." Locate the line in
examples/next-chakra-v3/README.md containing that sentence and replace the port
number 3001 with 3010 so the documented local URL matches the actual dev server.

Comment on lines +36 to +38
const toggleColorMode = () => {
setTheme(resolvedTheme === 'dark' ? 'light' : 'dark');
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Potential inconsistency in toggle logic.

Line 35 computes colorMode as forcedTheme || resolvedTheme, but line 37's toggleColorMode only checks resolvedTheme. If a theme is forced, the toggle might not behave as expected since it ignores the forcedTheme value.

🔧 Suggested fix to use computed colorMode
 export function useColorMode(): UseColorModeReturn {
     const { resolvedTheme, setTheme, forcedTheme } = useTheme();
     const colorMode = forcedTheme || resolvedTheme;
     const toggleColorMode = () => {
-        setTheme(resolvedTheme === 'dark' ? 'light' : 'dark');
+        setTheme(colorMode === 'dark' ? 'light' : 'dark');
     };
📝 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
const toggleColorMode = () => {
setTheme(resolvedTheme === 'dark' ? 'light' : 'dark');
};
export function useColorMode(): UseColorModeReturn {
const { resolvedTheme, setTheme, forcedTheme } = useTheme();
const colorMode = forcedTheme || resolvedTheme;
const toggleColorMode = () => {
setTheme(colorMode === 'dark' ? 'light' : 'dark');
};
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/next-chakra-v3/src/components/ui/color-mode.tsx` around lines 36 -
38, The toggleColorMode currently inspects resolvedTheme only, ignoring the
computed colorMode (forcedTheme || resolvedTheme) and causing inconsistent
behavior when a theme is forced; update the toggleColorMode function to use the
computed colorMode variable (the one derived from forcedTheme || resolvedTheme)
to decide the new theme, e.g., compute newTheme = colorMode === 'dark' ? 'light'
: 'dark' and call setTheme(newTheme) so toggling respects forcedTheme when
present.

Comment on lines +42 to +43
const secondaryDefault = tokVar('card.subtle');
const secondaryHover = tokVar('card.hover');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Incorrect token path references non-existent semantic token.

Line 43 reads card.hover but the theme defines card.subtle.hover (see theme.ts lines 61-66). This will cause tokVar('card.hover') to return an undefined or invalid CSS variable reference, breaking the secondary button hover state.

🐛 Fix the token path
     const primaryHover = tokVar('actions.primary.hover');
-    const secondaryDefault = tokVar('card.subtle');
-    const secondaryHover = tokVar('card.hover');
+    const secondaryDefault = tokVar('card.subtle');
+    const secondaryHover = tokVar('card.subtle.hover');
     const borderSecondary = tokVar('border.secondary');
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/next-chakra-v3/src/providers/VechainKitProviderWrapper.tsx` around
lines 42 - 43, secondaryHover is using an incorrect semantic token path so
tokVar('card.hover') returns undefined; update the reference in
VechainKitProviderWrapper where secondaryDefault and secondaryHover are set so
that secondaryHover uses the correct token path tokVar('card.subtle.hover')
(keep secondaryDefault as tokVar('card.subtle')) to match the theme's
card.subtle.hover token.

"i18next": "^24.2.1",
"i18next-browser-languagedetector": "^8.0.2",
"next": ">=15.2.3",
"next": "~16.2.3",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

Does Next.js version 16.2.3 exist and what are its requirements?

💡 Result:

Yes. Next.js v16.2.3 is an official release (tag v16.2.3, released April 8, 2026) and is described as a backport of security and bug fixes. [1]

Requirements (same as Next.js 16.x):

  • Node.js: 20.9.0+ (Node 18 is not supported) [2]
  • TypeScript (if used): 5.1.0+ [2]
  • Minimum supported browsers: Chrome 111+, Edge 111+, Firefox 111+, Safari 16.4+ [2]

Sources:
[1] (github.com)
[2] (nextjs.org)

Citations:


🏁 Script executed:

#!/bin/bash
# Description: Check npm registry for Next.js 16.2.3 availability

# Check if version 16.2.3 exists on npm
curl -s https://registry.npmjs.org/next | jq '.versions["16.2.3"]' | head -20

Repository: vechain/vechain-kit

Length of output: 369


Verify Node.js compatibility for Next.js 16.2.3.

Next.js v16.2.3 is a valid release (April 8, 2026) and is compatible with React 18. However, it requires Node.js 20.9.0 or later—Node 18 is not supported. Ensure your development and deployment environments are configured with Node.js 20.9.0+.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/playground/package.json` at line 21, The Next.js dependency "next":
"~16.2.3" requires Node.js >=20.9.0 but our project uses Node 18; update project
configuration to require Node 20.9.0+ by adding or updating the package.json
"engines" field to "node": ">=20.9.0" (or add an .nvmrc with 20.9.0 or later)
and ensure CI/deployment configs (e.g., any Dockerfile, GitHub Actions runners,
or build images) are set to use Node 20.9.0+ so builds and dev environments
match the requirement.

@github-actions

Copy link
Copy Markdown
Contributor

Size Change: 0 B

Total Size: 8.47 MB

ℹ️ View Unchanged
Filename Size
packages/vechain-kit/dist/assets 4.1 kB
packages/vechain-kit/dist/assets-BL24r-Yp.mjs 51.3 kB
packages/vechain-kit/dist/assets-BL24r-Yp.mjs.map 74.1 kB
packages/vechain-kit/dist/assets-DNJsQD7_.cjs 58.5 kB
packages/vechain-kit/dist/assets-DNJsQD7_.cjs.map 75.5 kB
packages/vechain-kit/dist/assets/index.cjs 716 B
packages/vechain-kit/dist/assets/index.d.cts 973 B
packages/vechain-kit/dist/assets/index.d.mts 973 B
packages/vechain-kit/dist/assets/index.mjs 718 B
packages/vechain-kit/dist/index-B7W1mM8I.d.mts 5.63 kB
packages/vechain-kit/dist/index-B7W1mM8I.d.mts.map 2.99 kB
packages/vechain-kit/dist/index-BS8tyFnY.d.cts 170 kB
packages/vechain-kit/dist/index-BS8tyFnY.d.cts.map 46.8 kB
packages/vechain-kit/dist/index-C8Uj8ple.d.cts 5.63 kB
packages/vechain-kit/dist/index-C8Uj8ple.d.cts.map 2.99 kB
packages/vechain-kit/dist/index-C9k6dYqf.d.mts 170 kB
packages/vechain-kit/dist/index-C9k6dYqf.d.mts.map 46.8 kB
packages/vechain-kit/dist/index.cjs 1.11 MB
packages/vechain-kit/dist/index.cjs.map 2.69 MB
packages/vechain-kit/dist/index.d.cts 22.8 kB
packages/vechain-kit/dist/index.d.mts 22.8 kB
packages/vechain-kit/dist/index.mjs 1.07 MB
packages/vechain-kit/dist/index.mjs.map 2.63 MB
packages/vechain-kit/dist/utils 4.1 kB
packages/vechain-kit/dist/utils-DJKLAzLP.cjs 27.2 kB
packages/vechain-kit/dist/utils-DJKLAzLP.cjs.map 67.2 kB
packages/vechain-kit/dist/utils-KYzX9d5n.mjs 22.1 kB
packages/vechain-kit/dist/utils-KYzX9d5n.mjs.map 66.5 kB
packages/vechain-kit/dist/utils/index.cjs 1.98 kB
packages/vechain-kit/dist/utils/index.d.cts 3.04 kB
packages/vechain-kit/dist/utils/index.d.mts 3.04 kB
packages/vechain-kit/dist/utils/index.mjs 2 kB

compressed-size-action

@Agilulfo1820 Agilulfo1820 merged commit 1a949bb into main May 15, 2026
7 checks passed
@Agilulfo1820 Agilulfo1820 deleted the feat/chakra-v3-repro-example branch May 15, 2026 05:22
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