Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ tmpclaude-*
.playwright-mcp/
.reviews/
Untracked/
AGENTS.md
26 changes: 26 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -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/`.
8 changes: 3 additions & 5 deletions KTL.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -3104,7 +3104,6 @@ function Ktl($, appInfo) {
} else {
console.log(`\t${search}=${kwInstanceStr}\n`);
result += ` ${search}=${kwInstanceStr}<br>`;
foundItemsCount++;
}
console.log('\n');
result += `<br>`;
Expand Down Expand Up @@ -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 });
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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');
},

Expand Down