Add Dark Mode feature#2
Open
emmanuelekopimo wants to merge 1 commit into
Open
Conversation
|
@emmanuelekopimo is attempting to deploy a commit to the Akinkunmi Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
There was a problem hiding this comment.
1 issue found across 22 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="frontend/src/routes/__root.tsx">
<violation number="1" location="frontend/src/routes/__root.tsx:20">
P2: Unguarded localStorage access in root theme initialization/persistence can throw and break app startup in storage-restricted environments.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| @@ -1,4 +1,5 @@ | |||
| import { Outlet, createRootRoute } from "@tanstack/react-router"; | |||
Contributor
There was a problem hiding this comment.
P2: Unguarded localStorage access in root theme initialization/persistence can throw and break app startup in storage-restricted environments.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At frontend/src/routes/__root.tsx, line 20:
<comment>Unguarded localStorage access in root theme initialization/persistence can throw and break app startup in storage-restricted environments.</comment>
<file context>
@@ -7,7 +8,35 @@ export const Route = createRootRoute({
+ return "light";
+ }
+
+ const saved = window.localStorage.getItem(THEME_STORAGE_KEY);
+ if (saved === "light" || saved === "dark") {
+ return saved;
</file context>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds dark mode to the frontend with a persistent theme toggle and updates the main app surfaces so the experience stays readable and visually consistent across pages and editor chrome.
What’s included
Notes
package-lock.jsonwas also updated in this commit.Summary by cubic
Adds Dark Mode across the app with a persistent theme toggle and expanded design tokens. Pages and editor chrome now use theme classes for consistent contrast; the editor also supports clipboard image paste and a canvas context menu.
New Features
localStorage(avnac-theme) and respects system preference on first load.styles.css(text, surfaces, borders, hover, overlays, shadows, buttons, inputs) and applied across Landing, Files, Create/editor flow, editor chrome, side panels, dialogs, and cards.LICENSE.Refactors
theme-toolbar-shell,theme-sidebar-panel,theme-primary-button,theme-secondary-button,theme-input,theme-glass-card,theme-segmented.var(--line),var(--overlay-backdrop),var(--text),var(--text-muted)); tuned contrast for sliders, artboard controls, sidebar text, and Files background.__root.tsxby settingdata-themeandcolor-scheme.Written for commit 8e91aeb. Summary will update on new commits.