Skip to content

feat: LOOKUP enforcement in REPLACE/grid-edit + BROWSE dropdown (#60)#64

Merged
DDecoene merged 4 commits into
release/v1.3.0from
feature/60-grid-enforcement
Jul 12, 2026
Merged

feat: LOOKUP enforcement in REPLACE/grid-edit + BROWSE dropdown (#60)#64
DDecoene merged 4 commits into
release/v1.3.0from
feature/60-grid-enforcement

Conversation

@DDecoene

Copy link
Copy Markdown
Owner

Summary

Builds on #58 (merged) to make LOOKUP an actually-enforced, actually-rendered constraint end-to-end via BROWSE:

  • REPLACE and grid-edit reject a value outside a column's declared LOOKUP, re-resolving the constraint fresh against the live database on every write — never trusting a client-held or previously-cached option list. A value that just became legal (a new row added to the source table) or just stopped being legal is judged correctly.
  • An unresolvable lookup (source table dropped, empty, or over 1000 distinct values) degrades to free entry with a ** Warning line rather than locking the column — enforcement never becomes a hard failure mode.
  • BROWSE renders a lookup column as a <select> fed by options Session.sendGridData resolves at grid-open. DISPLAY labels show while editing; the stored code shows once committed, so the grid never disagrees with LIST/report output.
  • All server-side checks are authoritative against forged/raw WS messages, not just the UI path — verified with dedicated tests that bypass the grid entirely.

This is the first PR where LOOKUP is documented in the README command reference (with a Deviations note — no dBASE III ancestor). Forms (@ SAY GET) still don't offer a picker; that's #59, a separate branch/PR.

Plan: docs/superpowers/plans/2026-07-11-lookup-columns.md (Tasks 6, 10, plus the REPLACE-enforcement half of Task 5)

Closes #60.

Test plan

  • npm test — 431/431 vitest pass
  • npm run build — clean typecheck + build
  • npx playwright test — 94/94 pass
  • Dedicated coverage: REPLACE accept/reject/case-sensitivity/live-source/degrade/two-database-scoping; grid-open ships exact resolved options and warns on degrade; grid-edit rejects a forged off-list message and confirms via LIST that nothing was written

DDecoene added 4 commits July 12, 2026 09:21
BROWSE/REPLACE now fully declare, enforce, and render lookups end to
end, so this is the first PR that promotes LOOKUP to the README
command reference (with an explicit Deviations note — no dBASE III
ancestor). Forms still don't offer a picker; that's #59.
@DDecoene DDecoene merged commit 735a362 into release/v1.3.0 Jul 12, 2026
2 checks passed
@DDecoene DDecoene deleted the feature/60-grid-enforcement branch July 12, 2026 09:10
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