Skip to content

Fix code quality issues and improve robustness#14

Open
jongaze77 wants to merge 1 commit intoworkeffortwaste:mainfrom
jongaze77:fix/code-quality-improvements
Open

Fix code quality issues and improve robustness#14
jongaze77 wants to merge 1 commit intoworkeffortwaste:mainfrom
jongaze77:fix/code-quality-improvements

Conversation

@jongaze77
Copy link
Copy Markdown

Summary

  • DOM fix: Move history panel inside <body> (beforeend) instead of invalid sibling after it
  • Listener leak fix: Use event delegation for View More/Less toggle instead of re-attaching listeners on every click
  • Remove dead code: Delete unused saver object and its assignment
  • Await limitDatabase(): Ensures errors propagate to the try-catch in lighthouseWatcher
  • "Copied!" feedback: Briefly shows confirmation text after clipboard copy
  • Webpack mode: 'production': Eliminates mode warning on every build
  • Graceful timeout: waitForElement failure logs a warning and exits early instead of crashing
  • Document trustedTypes bypass: Explains why the passthrough policy is intentional

Test plan

  • npm run build — no errors, no mode warning
  • Load unpacked dist/ in Chrome, test on pagespeed.web.dev
  • Verify Copy button shows "Copied!" feedback
  • Verify View More/Less toggles without console errors
  • Verify history panel renders correctly inside <body>

🤖 Generated with Claude Code

- Move history panel inside <body> (beforeend) for valid DOM structure
- Fix historyMore listener leak via event delegation on header
- Remove unused saver object
- Await limitDatabase() for proper error propagation
- Add "Copied!" feedback on clipboard copy
- Add mode: 'production' to webpack config to suppress warning
- Graceful fallback on waitForElement timeout
- Document the trustedTypes bypass policy

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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