diff --git a/.gitignore b/.gitignore index 19b4c09..081f257 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ tmpclaude-* .playwright-mcp/ .reviews/ Untracked/ +AGENTS.md \ No newline at end of file diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..9b7d421 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,26 @@ +# KTL Agent Instructions + +These instructions apply to work inside `LIB/KTL/`. + +## First Step +- Before editing KTL files, read `KTL_AI_Instructions.md` in this folder. +- Use `CLAUDE.md` in this folder alongside `KTL_AI_Instructions.md` when the task affects architecture, style rules, prompts, or user-facing behavior. + +## Core Rules +- Keep changes consistent with the KTL singleton and module pattern used in `KTL.js`. +- Reuse existing helpers in `ktl.core`, `ktl.views`, `ktl.fields`, `ktl.log`, and related modules before adding new functionality. +- Add broadly useful functionality to the appropriate existing `ktl.*` module instead of creating new globals. +- Prefer vanilla JavaScript for new code, but keep jQuery where existing Knack event hooks or Chosen integrations require it. +- Never use `alert()`; use the existing KTL prompt and confirmation patterns instead. + +## CSS And Keywords +- Prefix new CSS classes with `ktl` and follow the existing naming and grouping conventions in `KTL.css`. +- For keyword-driven features, keep underscore-prefixed keyword conventions and reuse the existing keyword parsing helpers. + +## Documentation +- Before changing an existing feature, check `Docs/` for related documentation and update it in the same change when needed. +- If a feature is complex and undocumented, add a focused doc under `Docs/` instead of creating scattered notes elsewhere. + +## Source Of Truth +- `KTL_AI_Instructions.md` is the detailed KTL-specific instruction file for this folder. +- If any repository-wide guidance conflicts with this folder's rules, follow the KTL-local guidance for files under `LIB/KTL/`. \ No newline at end of file diff --git a/KTL.js b/KTL.js index 474319f..fe0d342 100644 --- a/KTL.js +++ b/KTL.js @@ -22,7 +22,7 @@ function Ktl($, appInfo) { if (window.ktl) return window.ktl; - const KTL_VERSION = '0.42.4'; + const KTL_VERSION = '0.42.3'; const APP_KTL_VERSIONS = window.APP_VERSION + ' - ' + KTL_VERSION; window.APP_KTL_VERSIONS = APP_KTL_VERSIONS; @@ -3104,7 +3104,6 @@ function Ktl($, appInfo) { } else { console.log(`\t${search}=${kwInstanceStr}\n`); result += ` ${search}=${kwInstanceStr}
`; - foundItemsCount++; } console.log('\n'); result += `
`; @@ -7243,7 +7242,7 @@ function Ktl($, appInfo) { if (typeof fieldsAr === 'object') { for (var i = 0; i < fieldsAr.length; i++) { var field = Knack.objects.getField(type === 'form' ? fieldsAr[i].id : fieldsAr[i].key); - if (typeof field?.attributes?.meta === 'object') { + if (typeof field.attributes.meta === 'object') { var fldDescr = field.attributes.meta && field.attributes.meta.description; if (fldDescr && fldDescr.includes(descr)) { resolve({ viewId: viewId, fieldId: field.attributes.key }); @@ -23273,7 +23272,7 @@ function Ktl($, appInfo) { const ttipText = this.processTextMarkup(tooltipText); - const posEl = document.querySelector(tooltipIconPosition); + const posEl = pos.get(0); if (posEl) posEl.dataset.ktlTtipText = ttipText; $(`${tooltipIconPosition} i.${tooltipIcon}`).on('mouseenter.ktlTooltip', function (e) { @@ -29361,7 +29360,6 @@ function Ktl($, appInfo) { for (var i = 0; i < logArray.length; i++) msg += logArray[i] + ' '; msg = msg.slice(0, -1); - ktl.core.logCaller(2); console.log('%c' + msg, 'color:' + color + ';font-weight:bold'); },