Draft
MacroscopeApp / Macroscope - Correctness Check
succeeded
Jan 2, 2026 in 2m 12s
No issues identified (27 code objects reviewed).
• Merge Base:
5921c06
• Head:f089ecc
Details
| ✅ | File Path | Comments Posted |
|---|---|---|
| ✅ | apps/vscode-extension/src/extension.ts |
0 |
| ✅ | apps/vscode-extension/src/models/WebviewType.ts |
0 |
| ✅ | apps/vscode-extension/src/panels/ThemeBuilderPanel.ts |
0 |
| ✅ | apps/vscode-extension/src/services/ThemeBuilderService.ts |
0 |
| ✅ | apps/webviews/src/components/webviews/ThemeBuilderView.tsx |
0 |
| ✅ | apps/webviews/src/main.tsx |
0 |
| ✅ | packages/common/src/constants/Command.ts |
0 |
| ✅ | packages/common/src/constants/WebViewMessages.ts |
0 |
Filtered Issues Details
apps/vscode-extension/src/panels/ThemeBuilderPanel.ts
- line 32: The overridden
messageListenerdoes not callsuper.messageListener(message)for unhandled commands. The base classBaseWebview.messageListenerhandles essential commands likegetSetting,getFileContents, andrunCommand. By not calling the parent implementation, these commands will silently fail when sent toThemeBuilderPanel. [ Already posted ] - line 36: In
messageListener,payloadis destructured frommessagebut is passed to handlers likeloadTheme,loadLayout,saveTheme,saveLayout, andgetPreviewHtmlwithout validating thatpayloadis defined. If a message arrives without apayloadproperty, these handlers will receiveundefinedand crash when accessingpayload.nameorpayload.content(e.g., line 144 inloadThemeaccessespayload.name). [ Already posted ] - line 84: The
getExistingThemesmethod returns apathproperty in each theme object that contains just the filename, butloadThemereconstructs the path using onlypayload.nameand ignores thispathfield. If a theme filename differs from the sanitized name (e.g., due to special characters), the load will fail because the wrong path is constructed. [ Low confidence ] - line 88: In
getExistingThemes,file.replace('.css', '')on line 88 will replace all occurrences of.cssin the filename, not just the extension. A file namedmy.css.theme.csswould produce a name ofmythemeinstead ofmy.css.theme. Usefile.replace(/\.css$/, '')for safer extension removal. [ Already posted ] - line 153: In
loadTheme,loadLayout,saveTheme, andsaveLayout, the code accessespayload.nameandpayload.contentwithout validating thatpayloadis defined. If the webview sends a malformed message withpayloadasnullorundefined, accessingpayload.namewill throw aTypeError: Cannot read properties of undefined. [ Already posted ] - line 162: In
loadTheme, ifpayloadisnullorundefined(e.g., due to a malformed message from the webview), accessingpayload.nameon line 162 will throw aTypeError: Cannot read properties of null/undefined (reading 'name'). The function lacks validation thatpayloadexists before accessing its properties. [ Already posted ] - line 187: The
loadLayoutmethod hardcodes the.hbsextension when constructing the file path (line 187:`${payload.name}.hbs`), butgetExistingLayoutsreturns layouts with either.hbsor.handlebarsextensions. When a user selects a layout file that was originally named with.handlebarsextension, the load will fail because the code looks for.hbsinstead of using the original extension. [ Already posted ] - line 199: In
loadLayout, the path is constructed with a hardcoded.hbsextension (${payload.name}.hbson line 199), butgetExistingLayoutslists files with both.hbsand.handlebarsextensions (line 125). When a user selects a.handlebarsfile from the list and attempts to load it, the function will look for a non-existent.hbsfile and returnnull, silently failing to load the layout. [ Already posted ] - line 199: In
loadLayout, ifpayloadisnullorundefined, accessingpayload.nameon line 199 will throw aTypeError. The function lacks validation thatpayloadexists before accessing its properties. [ Already posted ] - line 242: In
saveTheme, ifpayloadisnullorundefined, accessingpayload.nameon line 242 will throw aTypeError. The function lacks validation thatpayloadand its required properties (name,content) exist. [ Already posted ] - line 281: In
saveLayout, ifpayloadisnullorundefined, accessingpayload.nameon line 281 will throw aTypeError. The function lacks validation thatpayloadand its required properties (name,content) exist. [ Already posted ]
apps/webviews/src/components/webviews/ThemeBuilderView.tsx
- line 80: The state variable
previewHtmland its settersetPreviewHtmlare declared but never used anywhere in the component. While not a runtime crash, this is dead code that should be removed. [ Low confidence ] - line 401: When the user selects the placeholder option "Select existing theme..." (which has
value=""), theonChangehandler callsloadTheme("")with an empty string. This triggers an async request to load a theme with an empty name, which will likely fail or return unexpected data from the backend. [ Already posted ] - line 583: After calling
removeTemplate(activeTemplate), the code readsObject.keys(themeConfig.slideTemplates)[0]to set the new active template. However,themeConfigis captured from the closure and still contains the old state (before the template was removed). This can result inactiveTemplatebeing set to the template that was just removed, causing the UI to attempt to render a non-existent template configuration. [ Already posted ]
Loading