You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We reviewed changes in 4919560...8d129dd on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.
Some issues found as part of this review are outside of the diff in this pull request and aren't shown in the inline review comments due to GitHub's API limitations. You can see those issues on the DeepSource dashboard.
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
The reason will be displayed to describe this comment to others. Learn more.
'VALID_HTML_ITEM_TYPES' is assigned a value but never used
Found variables that are declared but not used anywhere.
NOTE: In browser applications, DeepSource recommends the use of ESModules over regular text/javascript scripts.
Currently, we don't support variables that are not explicitly exported,
and are injected into other scripts by being included in an HTML file
The reason will be displayed to describe this comment to others. Learn more.
Variable name is too small
Short variable names affect code readability and complicate code refactoring, because of the difficulty in searching and replacing such short characters.
The reason will be displayed to describe this comment to others. Learn more.
Script URL is a form of eval
Using javascript: URLs is considered by some as a form of eval. Code passed in javascript: URLs has to be parsed and evaluated by the browser in the same way that eval is processed.
Adds a Show HTML tools setting, inline/context editors for HTML elements and per-item HTML rendering, and an advanced HTML preview tab (optionally runnable scripts). Also improves modal theming/scrolling, navmenu behavior, and sample template coverage.
Co-authored-by: Cursor <cursoragent@cursor.com>
The reason will be displayed to describe this comment to others. Learn more.
Variable name is too small
Short variable names affect code readability and complicate code refactoring, because of the difficulty in searching and replacing such short characters.
The reason will be displayed to describe this comment to others. Learn more.
`buildInlineStandardElement` has a cyclomatic complexity of 36 with "very-high" risk
A function with high cyclomatic complexity can be hard to understand and
maintain. Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A higher cyclomatic complexity indicates
that the function has more decision points and is more complex.
The reason will be displayed to describe this comment to others. Learn more.
Variable name is too small
Short variable names affect code readability and complicate code refactoring, because of the difficulty in searching and replacing such short characters.
The reason will be displayed to describe this comment to others. Learn more.
`buildInlineStandardElement` has a cyclomatic complexity of 36 with "very-high" risk
A function with high cyclomatic complexity can be hard to understand and
maintain. Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A higher cyclomatic complexity indicates
that the function has more decision points and is more complex.
The reason will be displayed to describe this comment to others. Learn more.
'openInlineHtmlElementEditor' is defined but never used
Found variables that are declared but not used anywhere.
NOTE: In browser applications, DeepSource recommends the use of ESModules over regular text/javascript scripts.
Currently, we don't support variables that are not explicitly exported,
and are injected into other scripts by being included in an HTML file
The reason will be displayed to describe this comment to others. Learn more.
'canToggleHtmlForItem' is defined but never used
Found variables that are declared but not used anywhere.
NOTE: In browser applications, DeepSource recommends the use of ESModules over regular text/javascript scripts.
Currently, we don't support variables that are not explicitly exported,
and are injected into other scripts by being included in an HTML file
The reason will be displayed to describe this comment to others. Learn more.
'isInlineHtmlElement' is defined but never used
Found variables that are declared but not used anywhere.
NOTE: In browser applications, DeepSource recommends the use of ESModules over regular text/javascript scripts.
Currently, we don't support variables that are not explicitly exported,
and are injected into other scripts by being included in an HTML file
The reason will be displayed to describe this comment to others. Learn more.
'getInlineContentHtml' is defined but never used
Found variables that are declared but not used anywhere.
NOTE: In browser applications, DeepSource recommends the use of ESModules over regular text/javascript scripts.
Currently, we don't support variables that are not explicitly exported,
and are injected into other scripts by being included in an HTML file
…ode)
- Use template literals and optional chaining in app.js and advanced-html-preview
- Brace navmenu case in addItem switch; tighten isHtmlToolsEnabled and hasHtmlItems
- Rename short variables in navmenu and inline option builder
- Extract HTML override helpers to lower buildInlineStandardElement complexity
- Remove unused helpers; wire openInlineHtmlElementEditor via inline context menu
Co-authored-by: Cursor <cursoragent@cursor.com>
The reason will be displayed to describe this comment to others. Learn more.
`buildInlineStandardElement` has a cyclomatic complexity of 28 with "very-high" risk
A function with high cyclomatic complexity can be hard to understand and
maintain. Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A higher cyclomatic complexity indicates
that the function has more decision points and is more complex.
- Compute contentWithIcons per item in renderInlinePreview (fixes undefined ref)
- Replace large switches with handler maps in inline and classic builders
- Split handleLiveInput into smaller helpers for DeepSource JS-R1005
Co-authored-by: Cursor <cursoragent@cursor.com>
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This WIP PR expands CookieCut’s document editor with an HTML-tools workflow: new HTML-oriented item types, per-item code/HTML editing affordances, and a separate “advanced” preview path for richer HTML output. It touches the editor state, both classic/inline builders, preview UI, sanitization helpers, and sample/template content.
Changes:
Adds HTML-tool settings/UI, including new modal options, a preview button, and classic/inline editor wiring for HTML-related controls.
Introduces new item types (button, navmenu, dropdown, frame, codescript) plus new handlers, styles, and sample template data.
Adds HTML sanitization and a new advanced HTML preview module intended for richer preview/export behavior.
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 12 comments.
Show a summary per file
File
Description
templates/default/all-items.cookie
Adds sample data for new HTML-oriented item types.
styles.css
Adds styling for HTML-mode controls and new rendered elements.
partials/preview-panel.html
Adds an HTML preview button and responsive preview controls layout.
partials/modals.html
Expands text/settings modals for HTML tools and new item selections.
js/state.js
Persists the new showHtmlTools setting in app state defaults.
js/preview/advanced-html-preview.js
Adds a separate advanced HTML preview renderer/new-tab flow.
js/helpers.js
Adds HTML sanitization helpers for HTML-mode content rendering.
js/handlers/navmenu.js
Adds builder/preview rendering for navigation menu items.
js/handlers/frame.js
Adds builder/preview rendering for iframe/frame items.
js/handlers/dropdown.js
Adds builder/preview rendering for dropdown items.
js/handlers/codescript.js
Adds builder/preview rendering for raw HTML/script blocks.
js/handlers/button.js
Adds builder/preview rendering for button items.
js/global.js
Wires new item types, settings, modal actions, preview controls, and live-input handling.
js/dom.js
Registers new DOM references for HTML preview/settings controls.
js/builders/inline.js
Extends inline editor behavior for new HTML item types and context menus.
js/builders/classic.js
Extends classic builder inputs/preview rendering for new HTML item types and code view.
app.js
Improves bootstrap error handling for partial loading.
.gitignore
Normalizes the Firebase ignore entry to a directory pattern.
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
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.
isHtmlMode(),enableHtmlEditor(),disableHtmlEditor(), updatedsetEditorMode()in global.jsaddItem()sanitizeHtmlContent()to helpers.js{}HTML-toggle button per-item in classic builder header (HTML mode only)