From 18297d54c4459c2c170a4af5fd1699ce644edc28 Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Tue, 16 Sep 2025 16:29:52 +0000 Subject: [PATCH] fix(dees-table): Improve Lucene range comparisons, pin monaco-editor to 0.52.2, and add local dev metadata --- .serena/memories/done_checklist.md | 6 ++++++ .serena/memories/project_overview.md | 11 +++++++++++ .serena/memories/style_and_conventions.md | 5 +++++ .serena/memories/suggested_commands.md | 6 ++++++ changelog.md | 8 ++++++++ package.json | 2 +- pnpm-lock.yaml | 17 +++++------------ ts_web/00_commitinfo_data.ts | 2 +- ts_web/elements/dees-table/lucene.ts | 22 +++++++++++++++++----- 9 files changed, 60 insertions(+), 19 deletions(-) create mode 100644 .serena/memories/done_checklist.md create mode 100644 .serena/memories/project_overview.md create mode 100644 .serena/memories/style_and_conventions.md create mode 100644 .serena/memories/suggested_commands.md diff --git a/.serena/memories/done_checklist.md b/.serena/memories/done_checklist.md new file mode 100644 index 0000000..96054cd --- /dev/null +++ b/.serena/memories/done_checklist.md @@ -0,0 +1,6 @@ +Before finishing a task: +- Run `pnpm run build` to ensure TypeScript compile + bundling succeed. +- Verify `dist_ts_web/` and `dist_bundle/bundle.js` updated. +- Optionally run `pnpm run test` and inspect failures. +- Avoid changing public APIs unless required; keep changes scoped. +- Update readme or inline docs only if user-facing behavior changes. \ No newline at end of file diff --git a/.serena/memories/project_overview.md b/.serena/memories/project_overview.md new file mode 100644 index 0000000..254deda --- /dev/null +++ b/.serena/memories/project_overview.md @@ -0,0 +1,11 @@ +Project: @design.estate/dees-catalog +Purpose: A component library of dynamic Web Components (TypeScript) for building modern web apps. +Tech stack: TypeScript (ES2022, NodeNext), decorators, custom elements via @design.estate/dees-element (Lit-style), bundling with esbuild via @git.zone/tsbundle, TypeScript building via @git.zone/tsbuild (tsfolders), tests with @git.zone/tstest, various UI libs (tiptap, apexcharts, monaco-editor runtime via CDN), DOM helpers via @design.estate/dees-domtools. +Structure: +- ts_web/: source of web components and pages +- dist_ts_web/: transpiled TS output +- dist_bundle/: production bundle (bundle.js + map) +- test/: tests +- html/: static demo assets +Key configs: tsconfig.json sets ES2022, NodeNext module/resolution, decorators enabled, skipLibCheck enabled to avoid third-party d.ts issues. +Entrypoints: ts_web/index.ts for bundling; custom elements annotated with @customElement. diff --git a/.serena/memories/style_and_conventions.md b/.serena/memories/style_and_conventions.md new file mode 100644 index 0000000..46d5749 --- /dev/null +++ b/.serena/memories/style_and_conventions.md @@ -0,0 +1,5 @@ +Language: TypeScript, ES2022 target, NodeNext module + resolution. +Patterns: Web Components with @customElement decorators; class-based components extending DeesElement; styles via css/cssManager; template render via html tagged literal. +Typing: Prefer explicit types where practical; tolerate `any` for external browser-injected libs (e.g., monaco) to keep build healthy. +Config: skipLibCheck enabled to avoid third-party d.ts breakages; exclude built declaration outputs. +Formatting/Linting: Not explicitly configured; follow existing style (2-space indents, single quotes often, semicolons present). \ No newline at end of file diff --git a/.serena/memories/suggested_commands.md b/.serena/memories/suggested_commands.md new file mode 100644 index 0000000..20d68ee --- /dev/null +++ b/.serena/memories/suggested_commands.md @@ -0,0 +1,6 @@ +Build: pnpm run build +Watch: pnpm run watch +Test: pnpm run test +Docs: pnpm run buildDocs +Inspect bundle size: ls -lh dist_bundle/bundle.js +Open demo (if applicable): serve static `html/` with any web server \ No newline at end of file diff --git a/changelog.md b/changelog.md index e539419..8b9ce33 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,13 @@ # Changelog +## 2025-09-16 - 1.11.6 - fix(dees-table) +Improve Lucene range comparisons, pin monaco-editor to 0.52.2, and add local dev metadata + +- Fix lucene inRange behavior to correctly compare homogeneous types (strings, numbers, dates) and fall back to string comparison when needed (ts_web/elements/dees-table/lucene.ts). +- Pin monaco-editor to 0.52.2 in package.json to avoid a breaking upgrade regression observed with ^0.53.0. +- Add local development/tooling metadata and conveniences: .claude/settings.local.json (tool permissions) and .serena/ memory files (done_checklist, project_overview, style_and_conventions, suggested_commands). +- Minor housekeeping: update project dev docs / memories to capture build/test/checklist guidance. + ## 2025-09-16 - 1.11.5 - fix(ci) Add local Claude agent settings for CI tooling diff --git a/package.json b/package.json index e2830cc..5b66148 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "highlight.js": "11.11.1", "ibantools": "^4.5.1", "lucide": "^0.544.0", - "monaco-editor": "^0.53.0", + "monaco-editor": "0.52.2", "pdfjs-dist": "^4.10.38", "xterm": "^5.3.0", "xterm-addon-fit": "^0.8.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dfca3cc..4d00f4f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -75,8 +75,8 @@ importers: specifier: ^0.544.0 version: 0.544.0 monaco-editor: - specifier: ^0.53.0 - version: 0.53.0 + specifier: 0.52.2 + version: 0.52.2 pdfjs-dist: specifier: ^4.10.38 version: 4.10.38 @@ -2417,9 +2417,6 @@ packages: '@types/triple-beam@1.3.5': resolution: {integrity: sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==} - '@types/trusted-types@1.0.6': - resolution: {integrity: sha512-230RC8sFeHoT6sSUlRO6a8cAnclO06eeiq1QDfiv2FGCLWFvvERWgwIQD4FWqD9A69BN7Lzee4OXwoMVnnsWDw==} - '@types/trusted-types@2.0.7': resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==} @@ -4218,8 +4215,8 @@ packages: engines: {node: '>=10'} hasBin: true - monaco-editor@0.53.0: - resolution: {integrity: sha512-0WNThgC6CMWNXXBxTbaYYcunj08iB5rnx4/G56UOPeL9UVIUGGHA1GR0EWIh9Ebabj7NpCRawQ5b0hfN1jQmYQ==} + monaco-editor@0.52.2: + resolution: {integrity: sha512-GEQWEZmfkOGLdd3XK8ryrfWz3AIP8YymVXiPHEdewrUq7mh0qrKrfHLNCXcbB6sTnMLnOZ3ztSiKcciFUkIJwQ==} mongodb-connection-string-url@2.6.0: resolution: {integrity: sha512-WvTZlI9ab0QYtTYnuMLgobULWhokRjtC7db9LtcVfJ+Hsnyr5eo6ZtNAt3Ly24XZScGMelOcGtm7lSn0332tPQ==} @@ -9361,8 +9358,6 @@ snapshots: '@types/triple-beam@1.3.5': {} - '@types/trusted-types@1.0.6': {} - '@types/trusted-types@2.0.7': {} '@types/turndown@5.0.5': {} @@ -11532,9 +11527,7 @@ snapshots: mkdirp@1.0.4: {} - monaco-editor@0.53.0: - dependencies: - '@types/trusted-types': 1.0.6 + monaco-editor@0.52.2: {} mongodb-connection-string-url@2.6.0: dependencies: diff --git a/ts_web/00_commitinfo_data.ts b/ts_web/00_commitinfo_data.ts index f5d0be7..5119732 100644 --- a/ts_web/00_commitinfo_data.ts +++ b/ts_web/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@design.estate/dees-catalog', - version: '1.11.5', + version: '1.11.6', description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.' } diff --git a/ts_web/elements/dees-table/lucene.ts b/ts_web/elements/dees-table/lucene.ts index db97435..f0d80f3 100644 --- a/ts_web/elements/dees-table/lucene.ts +++ b/ts_web/elements/dees-table/lucene.ts @@ -99,12 +99,24 @@ export function compileLucenePredicate( const a = coerce(val); const lo = coerce(lower); const up = coerce(upper); - // if types differ, compare string forms - if (a.t !== lo.t || a.t !== up.t) { - const as = String(val ?? '').toLowerCase(); - return cmp(as, lower) >= 0 && cmp(as, upper) <= 0; + // All strings: lexical compare + if (a.t === 's' && lo.t === 's' && up.t === 's') { + const av = a.v as string; + return cmp(av, lo.v as string) >= 0 && cmp(av, up.v as string) <= 0; } - return a.v >= (lo.v as number) && a.v <= (up.v as number); + // All numbers + if (a.t === 'n' && lo.t === 'n' && up.t === 'n') { + const av = a.v as number; + return av >= (lo.v as number) && av <= (up.v as number); + } + // All dates (as numbers) + if (a.t === 'd' && lo.t === 'd' && up.t === 'd') { + const av = a.v as number; + return av >= (lo.v as number) && av <= (up.v as number); + } + // Fallback: compare string forms + const as = String(val ?? '').toLowerCase(); + return cmp(as, lower) >= 0 && cmp(as, upper) <= 0; }; return (row: T) => { for (const clause of ast.clauses) {