Commit Graph

12 Commits

Author SHA1 Message Date
Kantine Wrapper
9fddf74eb2 feat: implement internationalization for UI text, refactor localStorage keys, and add input validation for state setters. 2026-03-11 10:14:59 +01:00
Kantine Wrapper
d05812dbb2 feat: Add manual refresh for flagged items triggered by the alarm bell, including UI feedback and toast notifications. 2026-03-10 15:49:38 +01:00
Michael
dd1ab415d2 Merge pull request #6 from TauNeutrino/perf-optimize-tags-7950496920454073492
 Optimize tag badge generation with for...of
2026-03-10 13:52:12 +01:00
google-labs-jules[bot]
cbbb2f4073 perf: optimize tag badge generation in ui_helpers.js
Replaced redundant Array traversal (map().join('')) with a for...of loop
to construct the tagsHtml string. This avoids allocating a new array
for each item being rendered, reducing memory pressure and improving
rendering performance for menus with many tags.

Benchmark results (100,000 iterations):
- 0 tags: 13.3ms -> 4.0ms (~70% improvement)
- 1 tag: 60.9ms -> 46.7ms (~23% improvement)
- 10 tags: 489ms -> 411ms (~16% improvement)
- 50 tags: 2286ms -> 1942ms (~15% improvement)

Co-authored-by: TauNeutrino <1600410+TauNeutrino@users.noreply.github.com>
2026-03-10 12:51:57 +00:00
Michael
7759491395 Merge pull request #4 from TauNeutrino/fix-xss-vulnerability-2050985831484711700
🔒 security: fix XSS vulnerabilities in UI helpers and actions
2026-03-10 13:38:12 +01:00
google-labs-jules[bot]
a2b2ec227f security: escape dynamic content in innerHTML to prevent XSS
This commit addresses several XSS vulnerabilities by ensuring that
dynamic data from external APIs (GitHub) and error messages are
properly escaped before being rendered via innerHTML.

Affected areas:
- openVersionMenu error handling and version list
- showErrorModal title and button text
- showToast message content

All changes were verified with a reproduction test case.

Co-authored-by: TauNeutrino <1600410+TauNeutrino@users.noreply.github.com>
2026-03-10 12:37:54 +00:00
google-labs-jules[bot]
c20a5fb879 🧪 [testing improvement] add unit tests for GitHub API header generation
- Added `tests/test_api.js` to verify header generation in `src/api.js`.
- Included test cases for `githubHeaders` and `apiHeaders`.
- Followed the project's existing testing pattern using Node.js `vm` module.

Co-authored-by: TauNeutrino <1600410+TauNeutrino@users.noreply.github.com>
2026-03-10 12:34:30 +00:00
google-labs-jules[bot]
2f08a951b4 Refactor kantine.js into modular ES6 structure
Moved `kantine.js` into a `src/` directory with multiple modularized files:
- `api.js`: All API calls and constants
- `state.js`: State management (auth, cache, theme, tags, etc.)
- `utils.js`: Helpers for UI and Date formatting
- `ui.js`: DOM manipulation logic
- `events.js`: Initial DOM event listeners and logic hooks
- `actions.js`: Data fetching actions, local processing logic
- `ui_helpers.js`: UI helper functions (rendering modals, handling DOM injections)

Updated the `build-bookmarklet.sh` to compile with Webpack via newly created `webpack.config.js`. Updated all relevant test scripts to use the new output `dist/kantine.bundle.js` and modified logic to work within Webpack scopes.

Co-authored-by: TauNeutrino <1600410+TauNeutrino@users.noreply.github.com>
2026-03-10 11:55:36 +00:00
Kantine Wrapper
8b15760463 feat: Introduce language filter with DE/EN/ALL toggle for menu descriptions and update to version 1.6.0. 2026-03-04 13:11:34 +01:00
Kantine Wrapper
b1763135aa test(ui): massively expand DOM testing suite to cover all Modals and Actions (v1.4.18) 2026-02-24 20:50:19 +01:00
Kantine Wrapper
c2e3282131 fix(ui): restore highlight modal toggle event & add dom test suite (v1.4.17) 2026-02-24 20:40:54 +01:00
Kantine Wrapper
d895a5fb7c feat: immediate api refresh on flag, fix timestamp fallback (v1.4.14) 2026-02-24 15:31:48 +01:00