Skip to content

feat(342): per-model Column Projection toggle (model Settings tab)#45

Open
kennethphough wants to merge 1 commit into
mainfrom
feature/342-model-projection-toggle
Open

feat(342): per-model Column Projection toggle (model Settings tab)#45
kennethphough wants to merge 1 commit into
mainfrom
feature/342-model-projection-toggle

Conversation

@kennethphough

Copy link
Copy Markdown
Member

Summary

Adds a Column Projection switch to the model detail Settings tab. It reads/writes the allow_projection flag inside the model's controller_config JSON column (new in kyte-php v4.16.0). When on, the model's list/read endpoints honor the client's X-Kyte-Fields header and return only the requested columns instead of the full row — the user-facing, no-code enablement for the KYTE-#190 projection engine.

This is deliverable #2 of KYTE-#342 (DB-driven controller config). Backend deliverable #1 (the controller_config column + resolution chain + allow_projection wiring) merged in kyte-php PR #123 and is dogfood-verified on dev19.

What it does

  • New Settings-tab card with a switch, description, and inline save-status (mirrors the existing Sensitive toggle).
  • Prefill from controller_config.allow_projection.
  • Merge, don't clobber: toggling copies the existing controller_config object and sets only allow_projection, so any future flags are preserved.
  • Inline auto-save via a partial DataModel PUT ({ controller_config: "<json>" }). No name in the payload, so DataModelController skips the table-rename path (same safe partial-update path the Sensitive toggle uses). Revert-on-failure.
  • i18n: projection_* keys added to en/es/ja/ko.

Behavior / compatibility

  • Off by default — full rows, historical behavior. Zero change until a user opts a model in.
  • Requires kyte-php v4.16.0+. Against an older server the toggle persists its value but has no effect (server ignores controller_config).
  • Writing controller_config triggers the existing clearModelCache on DataModel update, so the change takes effect on the next request.

Verification

  • node build.mjs clean (esbuild, no syntax errors); all four locale JSONs parse.
  • Backend write-path confirmed: the update case in DataModelController explicitly supports metadata-only partial PUTs (the same path sensitive uses).
  • Pending: browser smoke on a localhost Shipyard pointed at a v4.16.0 dev server (toggle prefills, persists, survives reload; KyteTable payload trims when on). Needs the kyte-api-js X-Kyte-Fields header (PR feat: Shipyard 2.0.0 — JWT default + esbuild pipeline + sensitive/auth_mode toggles #39) on the client for the visible payload trim.

Note on built assets

Only source is committed (assets/js/source/, HTML, i18n, CHANGELOG). The minified assets/js/* output is gitignored and rebuilt by CI/release.

🤖 Generated with Claude Code

Adds a "Column Projection" switch to the model detail Settings tab that
reads/writes the allow_projection flag inside the model's controller_config
JSON column (kyte-php v4.16.0). Mirrors the existing Sensitive toggle:
inline auto-save via a partial DataModel PUT (no `name`, so the server skips
the table-rename path) with revert-on-failure. Merges into controller_config
rather than clobbering so future flags are preserved.

- app/model/index.html: second Settings-tab card + switch markup
- kyte-shipyard-model-details.js (source): parse/merge/PUT + prefill + revert
- i18n en/es/ja/ko: projection_* keys
- CHANGELOG: 2.4.0 entry

Requires kyte-php v4.16.0+ (controller_config column + projection opt-in).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant