-
Notifications
You must be signed in to change notification settings - Fork 122
chore: migrate radix, bump packages, audit #534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
6868d0e
5a875e5
cc8f933
026bd65
91911a2
53c7bbc
5b84bcb
5973673
8bf5ab6
78a74cc
49f7c6f
fa8b1de
ee7c67b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -10,15 +10,16 @@ export function useMonacoTheme( | |||||||||||||||||||||||||||||||||||||||||
| theme: "dark" | "light" | (string | {}) | ||||||||||||||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||||||||||||||
| const [themeloaded, setThemeLoaded] = useState(false); | ||||||||||||||||||||||||||||||||||||||||||
| // load theme initially | ||||||||||||||||||||||||||||||||||||||||||
| // load theme initially (from public/monaco-themes/grida-dark.json) | ||||||||||||||||||||||||||||||||||||||||||
| useEffect(() => { | ||||||||||||||||||||||||||||||||||||||||||
| if (!monaco) return; | ||||||||||||||||||||||||||||||||||||||||||
| import("monaco-themes/themes/Blackboard.json").then((data) => { | ||||||||||||||||||||||||||||||||||||||||||
| data.colors["editor.background"] = "#0D0D0D"; | ||||||||||||||||||||||||||||||||||||||||||
| monaco.editor.defineTheme("dark", data as any); | ||||||||||||||||||||||||||||||||||||||||||
| monaco.editor.setTheme(theme === "dark" ? "dark" : "light"); | ||||||||||||||||||||||||||||||||||||||||||
| setThemeLoaded(true); | ||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||
| fetch("/monaco-themes/grida-dark.json") | ||||||||||||||||||||||||||||||||||||||||||
| .then((res) => res.json()) | ||||||||||||||||||||||||||||||||||||||||||
| .then((data) => { | ||||||||||||||||||||||||||||||||||||||||||
| monaco.editor.defineTheme("dark", data as any); | ||||||||||||||||||||||||||||||||||||||||||
| monaco.editor.setTheme(theme === "dark" ? "dark" : "light"); | ||||||||||||||||||||||||||||||||||||||||||
| setThemeLoaded(true); | ||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+16
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing error handling on theme fetch — silent failure. If Add a Proposed fix fetch("/monaco-themes/grida-dark.json")
.then((res) => res.json())
.then((data) => {
monaco.editor.defineTheme("dark", data as any);
monaco.editor.setTheme(theme === "dark" ? "dark" : "light");
setThemeLoaded(true);
- });
+ })
+ .catch((err) => {
+ console.error("Failed to load Monaco theme:", err);
+ // Still mark as loaded so light theme fallback works
+ monaco.editor.setTheme("light");
+ setThemeLoaded(true);
+ });📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||
| // eslint-disable-next-line react-hooks/exhaustive-deps | ||||||||||||||||||||||||||||||||||||||||||
| }, [monaco]); | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: gridaco/grida
Length of output: 115
🏁 Script executed:
Repository: gridaco/grida
Length of output: 97
🏁 Script executed:
Repository: gridaco/grida
Length of output: 113
🏁 Script executed:
Repository: gridaco/grida
Length of output: 2114
🏁 Script executed:
Repository: gridaco/grida
Length of output: 10315
Use the shadcn
DropdownMenuTriggerinstead of the raw Radix primitive.This file imports
DropdownMenu as DropdownMenuPrimitivedirectly from"radix-ui"and usesDropdownMenuPrimitive.Triggerat lines 24 and 33, while using shadcn wrappers everywhere else (DropdownMenu,DropdownMenuContent,DropdownMenuLabel,DropdownMenuSeparator,DropdownMenuCheckboxItem). The shadcndropdown-menumodule exports aDropdownMenuTriggerwrapper that should be used instead. Remove the raw Radix import and addDropdownMenuTriggerto the shadcn imports.Proposed fix
🤖 Prompt for AI Agents