Skip to content

fix(demo): build demo DOM without innerHTML or static inline styles - #2

Merged
Quorafind merged 1 commit into
mainfrom
fix/demo-review-errors
Nov 28, 2026
Merged

Quorafind merged 1 commit into
mainfrom
fix/demo-review-errors

Conversation

@Quorafind

Copy link
Copy Markdown
Member

Why

The Obsidian review action that the Task Genius plugin runs also lints this submodule's demo page. In strict mode its 10 error-level findings fail the job (taskgenius/taskgenius-plugin#667): innerHTML templates and static style.cssText / style.display writes.

Changes (examples/demo only)

  • DOM APIs instead of innerHTML:
    • Log entries, day checkboxes and custom-view buttons are built with DOM APIs and textContent.
    • Handlers use addEventListener instead of inline onchange / onclick attributes.
    • Log entries are still prepended, newest first, and capped at 50.
  • Badge styles: the custom event icon, segment badge and time badge styles moved from style.cssText into index.css classes.
  • Panel toggle: the config/events panels use the hidden attribute instead of style.display. In index.html the events panel now starts hidden; before, it had style="display: none".

Verification

  • npm run build:demo passes.
  • Demo tsc: the only remaining error (registerBuiltInViews in main.ts:94) also exists on main.
  • Headless Edge render of the dev server shows:
    • 2 log entries, newest first;
    • 7 day checkboxes and the custom-view buttons;
    • the events panel hidden;
    • the calendar rendered.
  • The review action's ESLint config (pinned versions) finds 0 errors in examples/ source.

The Obsidian review action that the Task Genius plugin runs also lints
this submodule, and fails strict runs on these error-level findings.

- Build the log entries, day checkboxes and custom-view buttons with
  DOM APIs and textContent instead of innerHTML templates; bind their
  handlers with addEventListener instead of inline on* attributes.
- Move the custom event icon / segment / time badge styles from
  style.cssText into index.css classes.
- Toggle the config and events panels with the hidden attribute
  instead of style.display (the events panel starts hidden in
  index.html).
@Quorafind
Quorafind merged commit 314d5ee into main Nov 28, 2026
4 checks passed
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