From 9ad507278b5f35ff65f2a37c44bf297dbcc73698 Mon Sep 17 00:00:00 2001 From: Pierre Brisorgueil Date: Sun, 22 Feb 2026 10:27:03 +0100 Subject: [PATCH 01/12] docs(guardrails): enforce JSDoc on every new or modified function --- CLAUDE.md | 1 + ERRORS.md | 1 + 2 files changed, 2 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index e42a27b0a..4315298bc 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -51,6 +51,7 @@ The `.claude/` folder contains embedded settings, skills, and agents that are av - Avoid risky renames or moves of core stack paths used by downstream merges - Keep changes minimal and merge-friendly for downstream projects - Flag security or mergeability risks explicitly in reviews +- Every new or modified function must have a JSDoc header: one-line description, `@param` for each argument, `@returns` if the function returns a value ## Available embedded skills diff --git a/ERRORS.md b/ERRORS.md index feb2e64e1..f08f02772 100644 --- a/ERRORS.md +++ b/ERRORS.md @@ -12,3 +12,4 @@ Use this file as a compact memory of recurring AI mistakes. ## Entries - [2026-02-19] Vuetify 3 typography: computed/CSS media-query responsive headings -> use Vuetify responsive classes (example: `text-h5 text-sm-h4`) +- [2026-02-22] functions: added functions without JSDoc header -> always add JSDoc (description + @param + @returns) From 26cc510bebf458d8c4f2adb26e82fc059e98dbfb Mon Sep 17 00:00:00 2001 From: Pierre Brisorgueil Date: Sun, 22 Feb 2026 10:45:05 +0100 Subject: [PATCH 02/12] =?UTF-8?q?fix(guardrails):=20apply=20Copilot=20feed?= =?UTF-8?q?back=20=E2=80=94=20use=20@return,=20clarify=20async=20rule,=20s?= =?UTF-8?q?ync=20copilot-instructions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Use @return (no trailing s) to match codebase convention (CLAUDE.md, ERRORS.md) - Clarify when @return is required: non-void returns + always for async functions - Add JSDoc guardrail to .github/copilot-instructions.md to keep both AI instruction files in sync --- .github/copilot-instructions.md | 1 + CLAUDE.md | 2 +- ERRORS.md | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 73bc3ab31..49801d1b1 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -38,6 +38,7 @@ Use `.github/prompts/*.prompt.md` for guided workflows: - Avoid risky renames or moves of core stack paths used by downstream merges - Keep changes minimal and merge-friendly for downstream projects - Flag security or mergeability risks explicitly in reviews +- Every new or modified function must have a JSDoc header: one-line description, `@param` for each argument, `@return` for any non-void return value (always include `@return` for async functions to document the resolved value) ## Architecture and modularity diff --git a/CLAUDE.md b/CLAUDE.md index 4315298bc..f252b8165 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -51,7 +51,7 @@ The `.claude/` folder contains embedded settings, skills, and agents that are av - Avoid risky renames or moves of core stack paths used by downstream merges - Keep changes minimal and merge-friendly for downstream projects - Flag security or mergeability risks explicitly in reviews -- Every new or modified function must have a JSDoc header: one-line description, `@param` for each argument, `@returns` if the function returns a value +- Every new or modified function must have a JSDoc header: one-line description, `@param` for each argument, `@return` for any non-void return value (always include `@return` for async functions to document the resolved value) ## Available embedded skills diff --git a/ERRORS.md b/ERRORS.md index f08f02772..d3f17ce5e 100644 --- a/ERRORS.md +++ b/ERRORS.md @@ -12,4 +12,4 @@ Use this file as a compact memory of recurring AI mistakes. ## Entries - [2026-02-19] Vuetify 3 typography: computed/CSS media-query responsive headings -> use Vuetify responsive classes (example: `text-h5 text-sm-h4`) -- [2026-02-22] functions: added functions without JSDoc header -> always add JSDoc (description + @param + @returns) +- [2026-02-22] functions: added functions without JSDoc header -> always add JSDoc (description + @param + @return) From f92224a786a9c70be8fd25a17131bcdbb56ae42c Mon Sep 17 00:00:00 2001 From: Pierre Brisorgueil Date: Sun, 22 Feb 2026 11:08:54 +0100 Subject: [PATCH 03/12] fix(guardrails): add backticks to @param and @return in ERRORS.md for consistent Markdown rendering --- ERRORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ERRORS.md b/ERRORS.md index d3f17ce5e..b9a91cb56 100644 --- a/ERRORS.md +++ b/ERRORS.md @@ -12,4 +12,4 @@ Use this file as a compact memory of recurring AI mistakes. ## Entries - [2026-02-19] Vuetify 3 typography: computed/CSS media-query responsive headings -> use Vuetify responsive classes (example: `text-h5 text-sm-h4`) -- [2026-02-22] functions: added functions without JSDoc header -> always add JSDoc (description + @param + @return) +- [2026-02-22] functions: added functions without JSDoc header -> always add JSDoc (description + `@param` + `@return`) From 1876e498a416bdab09a9c8ede43df992921dac60 Mon Sep 17 00:00:00 2001 From: Pierre Brisorgueil Date: Sun, 22 Feb 2026 11:26:13 +0100 Subject: [PATCH 04/12] fix(jsdoc): standardize on @returns (canonical JSDoc tag) across docs and src MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Migrate @return → @returns in src/lib/helpers/theme.js, tools.js, middlewares/model.js - Update CLAUDE.md, copilot-instructions.md and ERRORS.md to use @returns - Ensures full consistency with JSDoc standard and Node stack convention --- .github/copilot-instructions.md | 3 ++- CLAUDE.md | 3 ++- ERRORS.md | 2 +- src/lib/helpers/theme.js | 14 +++++++------- src/lib/helpers/tools.js | 6 +++--- src/lib/middlewares/model.js | 2 +- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 49801d1b1..fb3b886bb 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -30,6 +30,7 @@ Use `.github/prompts/*.prompt.md` for guided workflows: | Create module | `.github/prompts/create-module.prompt.md` | | Update stack | `.github/prompts/update-stack.prompt.md` | | Naming | `.github/prompts/naming.prompt.md` | +| PR | `.github/prompts/pr.prompt.md` | ## Always-on guardrails @@ -38,7 +39,7 @@ Use `.github/prompts/*.prompt.md` for guided workflows: - Avoid risky renames or moves of core stack paths used by downstream merges - Keep changes minimal and merge-friendly for downstream projects - Flag security or mergeability risks explicitly in reviews -- Every new or modified function must have a JSDoc header: one-line description, `@param` for each argument, `@return` for any non-void return value (always include `@return` for async functions to document the resolved value) +- Every new or modified function must have a JSDoc header: one-line description, `@param` for each argument, `@returns` for any non-void return value (always include `@returns` for async functions to document the resolved value) ## Architecture and modularity diff --git a/CLAUDE.md b/CLAUDE.md index f252b8165..5be623f0b 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -51,7 +51,7 @@ The `.claude/` folder contains embedded settings, skills, and agents that are av - Avoid risky renames or moves of core stack paths used by downstream merges - Keep changes minimal and merge-friendly for downstream projects - Flag security or mergeability risks explicitly in reviews -- Every new or modified function must have a JSDoc header: one-line description, `@param` for each argument, `@return` for any non-void return value (always include `@return` for async functions to document the resolved value) +- Every new or modified function must have a JSDoc header: one-line description, `@param` for each argument, `@returns` for any non-void return value (always include `@returns` for async functions to document the resolved value) ## Available embedded skills @@ -64,6 +64,7 @@ Use `.claude/skills/*/SKILL.md` as the primary workflow source for Claude. | `/feature` | Implement a feature while enforcing module isolation | | `/update-stack` | Merge upstream stack updates into downstream projects | | `/naming` | Apply or audit naming conventions | +| `/pr` | Full PR lifecycle: branch, commit, issue, monitor | ## Embedded agent diff --git a/ERRORS.md b/ERRORS.md index b9a91cb56..3afc06b2e 100644 --- a/ERRORS.md +++ b/ERRORS.md @@ -12,4 +12,4 @@ Use this file as a compact memory of recurring AI mistakes. ## Entries - [2026-02-19] Vuetify 3 typography: computed/CSS media-query responsive headings -> use Vuetify responsive classes (example: `text-h5 text-sm-h4`) -- [2026-02-22] functions: added functions without JSDoc header -> always add JSDoc (description + `@param` + `@return`) +- [2026-02-22] functions: added functions without JSDoc header -> always add JSDoc (description + `@param` + `@returns`) diff --git a/src/lib/helpers/theme.js b/src/lib/helpers/theme.js index 4031a0ac9..b6b4168b4 100644 --- a/src/lib/helpers/theme.js +++ b/src/lib/helpers/theme.js @@ -1,7 +1,7 @@ /** * @desc Function to return actual theme * @param {String} option in config - * @return {Boolean} dark value + * @returns {Boolean} dark value */ export const isDark = (theme) => { if (theme === 'auto') { @@ -13,7 +13,7 @@ export const isDark = (theme) => { /** * @desc Function to return custom css object * @param {String} String, section, card, video - * @return {Object} object in config { background: ... } + * @returns {Object} object in config { background: ... } */ export const style = (kind, object) => { const style = {}; @@ -41,7 +41,7 @@ export const style = (kind, object) => { /** * @desc Helper to convert hex color to RGB string * @param {String} hex - Hex color (e.g. #RRGGBB) - * @return {String} RGB string (e.g. "255,255,255") + * @returns {String} RGB string (e.g. "255,255,255") */ const hexToRgb = (hex) => { const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); @@ -53,7 +53,7 @@ const hexToRgb = (hex) => { * @param {String} hex - Hex color (e.g. #RRGGBB) * @param {Number} amount - Amount to adjust (-1 to 1, or 0-100 for legacy percent mode) * @param {String} output - 'rgb' for RGB string, 'hex' for hex string. Default: 'rgb' - * @return {String} RGB string (e.g. "255,255,255") or hex string (e.g. "#ffffff") + * @returns {String} RGB string (e.g. "255,255,255") or hex string (e.g. "#ffffff") */ const adjustColor = (hex, amount, output = 'rgb') => { const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); @@ -97,7 +97,7 @@ const adjustColor = (hex, amount, output = 'rgb') => { * @param {String} options.border - 'all', 'bottom', 'top', or 'none'. Default: 'all' * @param {Boolean|String} options.glowBorder - false, true (static gradient), or 'animated' (rotating). Default: false * @param {Object} options.extras - Additional CSS properties to merge - * @return {Object} CSS style object with liquid glass effect + * @returns {Object} CSS style object with liquid glass effect */ export const liquidGlassStyle = ({ vuetifyTheme, @@ -208,7 +208,7 @@ export const liquidGlassStyle = ({ * @desc Generate overlap style for container (slides up into previous section) * @param {Boolean|String|Object} overlap - true (defaults), string ('30vh'), or { mobile: '20vh', desktop: '40vh' } * @param {Object} display - Vuetify display object ($vuetify.display) - * @return {Object} Style object with margin-top, position and z-index + * @returns {Object} Style object with margin-top, position and z-index */ export const overlapStyle = (overlap, display) => { if (!overlap) return {}; @@ -235,7 +235,7 @@ export const overlapStyle = (overlap, display) => { * @desc Helper to lighten a hex color * @param {String} hex - Hex color (e.g. #RRGGBB) * @param {Number} percent - Percentage to lighten (0-100) - * @return {String} Hex color string + * @returns {String} Hex color string */ export const lightenColor = (hex, percent) => adjustColor(hex, percent, 'hex'); diff --git a/src/lib/helpers/tools.js b/src/lib/helpers/tools.js index db78b4463..44f16f92b 100644 --- a/src/lib/helpers/tools.js +++ b/src/lib/helpers/tools.js @@ -5,7 +5,7 @@ /** * @desc Function to evaluate numbers of release from last release * @param {String} 2.3.4 - * @return {String} 23 + * @returns {String} 23 */ export const releasesNumber = (release) => { const numbers = release[0] === 'v' ? release.substr(1).split('.') : release.split('.'); // get numbers last release @@ -19,7 +19,7 @@ export const releasesNumber = (release) => { * @param {Int} page * @param {Int} perPage * @param {String} search - * @return {String} server-items-length + * @returns {String} server-items-length */ export const pageRequest = (page, perPage, search) => { let request = `${page - 1}&${perPage}`; @@ -31,7 +31,7 @@ export const pageRequest = (page, perPage, search) => { * @desc Function get a dynamic total count from dataTable * @param {Array} array of items * @param {Object} Object options from vuetify dataTable - * @return {String} server-items-length + * @returns {String} server-items-length */ export const serverItemsLength = (items, options) => items.length === options.itemsPerPage ? options.page * options.itemsPerPage + options.itemsPerPage : options.page * options.itemsPerPage; diff --git a/src/lib/middlewares/model.js b/src/lib/middlewares/model.js index 1b9318d33..c38edccb3 100644 --- a/src/lib/middlewares/model.js +++ b/src/lib/middlewares/model.js @@ -7,7 +7,7 @@ import _ from 'lodash'; * @desc Function to clean object (pick from model, remove null / undefined) * @param {Object} data * @param {[String]} model - * @return {Object} result + * @returns {Object} result */ const clean = (data, model) => _.omitBy(_.pick(data, model), _.isNull); From 22f8f483fb1627758591e33d42837a5a2cef64bf Mon Sep 17 00:00:00 2001 From: Pierre Brisorgueil Date: Sun, 22 Feb 2026 11:35:55 +0100 Subject: [PATCH 05/12] fix(jsdoc): fix JSDoc accuracy and remove stray /pr reference - theme.js: add param names to isDark and style, document both args - tools.js: fix releasesNumber param name and Array return type - tools.js: fix serverItemsLength @returns to number - model.js: fix description (null only) and improve @param/@returns - CLAUDE.md, copilot-instructions.md: remove /pr row (wrong PR) --- .github/copilot-instructions.md | 1 - CLAUDE.md | 1 - src/lib/helpers/theme.js | 5 +++-- src/lib/helpers/tools.js | 10 +++++----- src/lib/middlewares/model.js | 8 ++++---- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index fb3b886bb..0f089bceb 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -30,7 +30,6 @@ Use `.github/prompts/*.prompt.md` for guided workflows: | Create module | `.github/prompts/create-module.prompt.md` | | Update stack | `.github/prompts/update-stack.prompt.md` | | Naming | `.github/prompts/naming.prompt.md` | -| PR | `.github/prompts/pr.prompt.md` | ## Always-on guardrails diff --git a/CLAUDE.md b/CLAUDE.md index 5be623f0b..e369a58cd 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -64,7 +64,6 @@ Use `.claude/skills/*/SKILL.md` as the primary workflow source for Claude. | `/feature` | Implement a feature while enforcing module isolation | | `/update-stack` | Merge upstream stack updates into downstream projects | | `/naming` | Apply or audit naming conventions | -| `/pr` | Full PR lifecycle: branch, commit, issue, monitor | ## Embedded agent diff --git a/src/lib/helpers/theme.js b/src/lib/helpers/theme.js index b6b4168b4..d5ba5895c 100644 --- a/src/lib/helpers/theme.js +++ b/src/lib/helpers/theme.js @@ -1,6 +1,6 @@ /** * @desc Function to return actual theme - * @param {String} option in config + * @param {String} theme - Theme option from config ('dark', 'light', or 'auto') * @returns {Boolean} dark value */ export const isDark = (theme) => { @@ -12,7 +12,8 @@ export const isDark = (theme) => { /** * @desc Function to return custom css object - * @param {String} String, section, card, video + * @param {String} kind - Style section key (e.g. 'section', 'card', 'video') + * @param {Object} object - Config object containing the style definitions * @returns {Object} object in config { background: ... } */ export const style = (kind, object) => { diff --git a/src/lib/helpers/tools.js b/src/lib/helpers/tools.js index 44f16f92b..9adbfbae8 100644 --- a/src/lib/helpers/tools.js +++ b/src/lib/helpers/tools.js @@ -4,8 +4,8 @@ /** * @desc Function to evaluate numbers of release from last release - * @param {String} 2.3.4 - * @returns {String} 23 + * @param {String} release - Version string (e.g. '2.3.4' or 'v2.3.4') + * @returns {Array} Array of version number parts */ export const releasesNumber = (release) => { const numbers = release[0] === 'v' ? release.substr(1).split('.') : release.split('.'); // get numbers last release @@ -29,9 +29,9 @@ export const pageRequest = (page, perPage, search) => { /** * @desc Function get a dynamic total count from dataTable - * @param {Array} array of items - * @param {Object} Object options from vuetify dataTable - * @returns {String} server-items-length + * @param {Array} items - Array of items from the current page + * @param {Object} options - Options object from Vuetify dataTable + * @returns {number} server items length */ export const serverItemsLength = (items, options) => items.length === options.itemsPerPage ? options.page * options.itemsPerPage + options.itemsPerPage : options.page * options.itemsPerPage; diff --git a/src/lib/middlewares/model.js b/src/lib/middlewares/model.js index c38edccb3..c68cb6ecf 100644 --- a/src/lib/middlewares/model.js +++ b/src/lib/middlewares/model.js @@ -4,10 +4,10 @@ import _ from 'lodash'; /** - * @desc Function to clean object (pick from model, remove null / undefined) - * @param {Object} data - * @param {[String]} model - * @returns {Object} result + * @desc Function to clean object (pick from model, remove null values) + * @param {Object} data - Source object to clean + * @param {Array} model - Array of keys to pick from data + * @returns {Object} Cleaned object with only model keys and non-null values */ const clean = (data, model) => _.omitBy(_.pick(data, model), _.isNull); From ed8bc1d3cc5e02c36041a0add07b92286df9f6e7 Mon Sep 17 00:00:00 2001 From: Pierre Brisorgueil Date: Sun, 22 Feb 2026 12:25:27 +0100 Subject: [PATCH 06/12] fix(jsdoc): fix pageRequest @returns description to match actual return value --- src/lib/helpers/tools.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/helpers/tools.js b/src/lib/helpers/tools.js index 9adbfbae8..9ea4beb6d 100644 --- a/src/lib/helpers/tools.js +++ b/src/lib/helpers/tools.js @@ -19,7 +19,7 @@ export const releasesNumber = (release) => { * @param {Int} page * @param {Int} perPage * @param {String} search - * @returns {String} server-items-length + * @returns {String} Pagination request string */ export const pageRequest = (page, perPage, search) => { let request = `${page - 1}&${perPage}`; From df694306247f73392c7321ab2bed328ff8800c46 Mon Sep 17 00:00:00 2001 From: Pierre Brisorgueil Date: Sun, 22 Feb 2026 12:38:03 +0100 Subject: [PATCH 07/12] fix(theme): isDark now returns false for 'light', aligns logic with JSDoc --- src/lib/helpers/theme.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/helpers/theme.js b/src/lib/helpers/theme.js index d5ba5895c..4489477b1 100644 --- a/src/lib/helpers/theme.js +++ b/src/lib/helpers/theme.js @@ -1,13 +1,13 @@ /** * @desc Function to return actual theme * @param {String} theme - Theme option from config ('dark', 'light', or 'auto') - * @returns {Boolean} dark value + * @returns {Boolean} true if dark mode is active, false otherwise */ export const isDark = (theme) => { if (theme === 'auto') { return !!(window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches); } - return !!theme; + return theme === 'dark'; }; /** From 8fb05f8b3157406a4e55a1dcc907972ef3228eee Mon Sep 17 00:00:00 2001 From: Pierre Brisorgueil Date: Sun, 22 Feb 2026 12:40:53 +0100 Subject: [PATCH 08/12] fix(theme): isDark accepts boolean and string, fix regression for isDark(true) --- src/lib/helpers/theme.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/helpers/theme.js b/src/lib/helpers/theme.js index 4489477b1..84d38ab65 100644 --- a/src/lib/helpers/theme.js +++ b/src/lib/helpers/theme.js @@ -1,13 +1,13 @@ /** * @desc Function to return actual theme - * @param {String} theme - Theme option from config ('dark', 'light', or 'auto') + * @param {String|Boolean} theme - Theme option: 'dark'|true for dark, 'light'|false for light, 'auto' for system * @returns {Boolean} true if dark mode is active, false otherwise */ export const isDark = (theme) => { if (theme === 'auto') { return !!(window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches); } - return theme === 'dark'; + return theme === 'dark' || theme === true; }; /** From 5db5e656cec3fd96e8859b70c446dfcf4ecc4b8b Mon Sep 17 00:00:00 2001 From: Pierre Brisorgueil Date: Sun, 22 Feb 2026 12:42:17 +0100 Subject: [PATCH 09/12] fix(jsdoc): align ERRORS.md wording with guardrail (new or modified functions) --- ERRORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ERRORS.md b/ERRORS.md index 3afc06b2e..184eda7a8 100644 --- a/ERRORS.md +++ b/ERRORS.md @@ -12,4 +12,4 @@ Use this file as a compact memory of recurring AI mistakes. ## Entries - [2026-02-19] Vuetify 3 typography: computed/CSS media-query responsive headings -> use Vuetify responsive classes (example: `text-h5 text-sm-h4`) -- [2026-02-22] functions: added functions without JSDoc header -> always add JSDoc (description + `@param` + `@returns`) +- [2026-02-22] functions: new or modified functions without JSDoc header -> always add JSDoc (description + `@param` + `@returns`) From 6599c76ffda2cc7eabf5811ca3c02153e4bf67b8 Mon Sep 17 00:00:00 2001 From: Pierre Brisorgueil Date: Sun, 22 Feb 2026 12:50:35 +0100 Subject: [PATCH 10/12] fix(theme): isDark accepts only string, light by default, remove boolean legacy --- src/lib/helpers/tests/theme.spec.js | 14 ++++++-------- src/lib/helpers/theme.js | 4 ++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/lib/helpers/tests/theme.spec.js b/src/lib/helpers/tests/theme.spec.js index eb9b5ddc1..4e6da12e6 100644 --- a/src/lib/helpers/tests/theme.spec.js +++ b/src/lib/helpers/tests/theme.spec.js @@ -8,20 +8,18 @@ describe('Theme Helpers', () => { delete window.matchMedia; }); - it('should return true when theme is explicitly true', () => { - expect(isDark(true)).toBe(true); + it('should return true when theme is dark', () => { + expect(isDark('dark')).toBe(true); }); - it('should return false when theme is explicitly false', () => { - expect(isDark(false)).toBe(false); + it('should return false when theme is light', () => { + expect(isDark('light')).toBe(false); }); - it('should return false when theme is undefined', () => { + it('should return false for unknown or missing theme (light by default)', () => { expect(isDark(undefined)).toBe(false); - }); - - it('should return false when theme is null', () => { expect(isDark(null)).toBe(false); + expect(isDark('')).toBe(false); }); it('should detect auto dark mode from system preferences (dark)', () => { diff --git a/src/lib/helpers/theme.js b/src/lib/helpers/theme.js index 84d38ab65..4489477b1 100644 --- a/src/lib/helpers/theme.js +++ b/src/lib/helpers/theme.js @@ -1,13 +1,13 @@ /** * @desc Function to return actual theme - * @param {String|Boolean} theme - Theme option: 'dark'|true for dark, 'light'|false for light, 'auto' for system + * @param {String} theme - Theme option from config ('dark', 'light', or 'auto') * @returns {Boolean} true if dark mode is active, false otherwise */ export const isDark = (theme) => { if (theme === 'auto') { return !!(window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches); } - return theme === 'dark' || theme === true; + return theme === 'dark'; }; /** From bae93cf2ba1a5c02d0ce6b9c1f2dd5e425546322 Mon Sep 17 00:00:00 2001 From: Pierre Brisorgueil Date: Sun, 22 Feb 2026 12:57:23 +0100 Subject: [PATCH 11/12] chore(errors): never patch code to pass a test, refactor if needed --- ERRORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ERRORS.md b/ERRORS.md index 184eda7a8..0a22b6d89 100644 --- a/ERRORS.md +++ b/ERRORS.md @@ -13,3 +13,4 @@ Use this file as a compact memory of recurring AI mistakes. - [2026-02-19] Vuetify 3 typography: computed/CSS media-query responsive headings -> use Vuetify responsive classes (example: `text-h5 text-sm-h4`) - [2026-02-22] functions: new or modified functions without JSDoc header -> always add JSDoc (description + `@param` + `@returns`) +- [2026-02-22] tests: never patch code to pass a test -> if a test is wrong, fix the test; if logic needs refactoring, refactor it From 568f2b3cb8430bb029297ad44df0d01fde3a28ec Mon Sep 17 00:00:00 2001 From: Pierre Brisorgueil Date: Sun, 22 Feb 2026 13:00:08 +0100 Subject: [PATCH 12/12] fix(errors): align ERRORS.md JSDoc rule with guardrail nuance (non-void + async) --- ERRORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ERRORS.md b/ERRORS.md index 0a22b6d89..076086975 100644 --- a/ERRORS.md +++ b/ERRORS.md @@ -12,5 +12,5 @@ Use this file as a compact memory of recurring AI mistakes. ## Entries - [2026-02-19] Vuetify 3 typography: computed/CSS media-query responsive headings -> use Vuetify responsive classes (example: `text-h5 text-sm-h4`) -- [2026-02-22] functions: new or modified functions without JSDoc header -> always add JSDoc (description + `@param` + `@returns`) +- [2026-02-22] functions: new or modified functions without JSDoc header -> always add JSDoc (description + `@param` for each arg + `@returns` for non-void return values and all async functions) - [2026-02-22] tests: never patch code to pass a test -> if a test is wrong, fix the test; if logic needs refactoring, refactor it