feat(cli): tighten column-selection UX in init / schema build#398
feat(cli): tighten column-selection UX in init / schema build#398
Conversation
🦋 Changeset detectedLatest commit: 5898748 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 👉 Get your free trial and get 200 agent minutes per Slack user (a $50 value). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 26 minutes and 37 seconds.Comment |
76e37c0 to
a48645c
Compare
583d1be to
5314d3f
Compare
006b3c5 to
4f5fd07
Compare
4f5fd07 to
a535705
Compare
- Lift eql_v2_encrypted columns out of the multiselect; show them as a
"will be kept as-is" note and merge them into the schema automatically.
Closest we can get to "displayed but not toggleable" given clack has
no disabled-row affordance.
- Drop required:true. Empty submissions now route to an explicit recovery:
warn-and-reprompt with no priors, or "Skip encryption for the <x> table?"
confirm when at least one other table has been configured this run.
- Confirmation summary after >=1 column picked, with re-prompt on no.
- All-already-encrypted edge case: skip the multiselect and confirm
"keep as-is?" so we never offer an empty picker.
- selectTableColumns return type is now a discriminated
{ kind: 'schema' | 'skip' | 'cancel' } so the outer loop tells skip
from cancel.
- Filter eql_v2_* tables out of introspection. eql_v2_configuration is
EQL's own configuration store; encrypting it would break EQL itself.
a535705 to
5898748
Compare
|
Heads-up: this is now redundant — the column-picker this PR tightens has been removed entirely in #357. The reshape: post-#395 the agent (Claude / Codex / Cursor / Windsurf / Cline / wizard) drives schema decisions in conversation after init hands off, not via an interactive picker at init time. That makes each fix here moot:
The underlying instinct here was right — making sure init can't accidentally re-encrypt or step on EQL's own tables. Those guards now live one layer down in the agent's orient-and-route prompt + the The smaller UX win (read-back-the-selection confirm) is also moot, but worth keeping in mind if we ever reintroduce a picker for a Proxy-mode workflow that doesn't have an agent in the loop. #396 (the underlying bug this PR closes) is gone with the picker — proposing we close this PR as well-intended-but-superseded. |
Closes #396.
Stacked on #395 — review #395 first.
Summary
Three closely related fixes to the per-table column picker used by
stash initandstash schema build:required: trueon the multiselect and handles the empty case explicitly: warn-and-reprompt if no other tables have been configured this run, or offer "Skip encryption for the<x>table" as an explicit escape if priors exist.eql_v2_encryptedare surfaced above the prompt as a "will be kept as-is" note and merged into the schema automatically. clack has no disabled-row affordance, so this is the closest we get to "displayed but not selectable". If every column in a table is already encrypted, the multiselect is skipped and we just confirm "keep as-is?".eql_v2_*(e.g.eql_v2_configuration) is excluded from introspection so it never appears as a candidate — encrypting EQL's own configuration store would brick EQL.Plus a small UX win: after a user picks ≥1 column, init reads back the selection (
Encrypt 3 columns in "users" (email, name, and ssn)?) and lets them back out into the picker if they misclicked.API change
selectTableColumnsnow returns a discriminated{ kind: 'schema' | 'skip' | 'cancel' }sobuildSchemasFromDatabasecan tell "user skipped this one table" from "user cancelled the whole flow". The outer return shape (SchemaDef[] | undefined) is unchanged.Out of scope
introspectDatabasestill only scans thepublicschema. Filed #397 to track the broader question of multi-schema support — would expand the surface here meaningfully and is better as its own change.Test plan
buildColumnDefs,joinNames,pgTypeToDataType,allSearchOps) — 18 new tests inlib/__tests__/introspect.test.ts.stash initagainst a project that already has one EQL column on a re-run; confirm pre-encrypted columns appear as a "kept as-is" note (not in the picker), the multiselect requires ≥1 new pick, and the confirmation summary fires before moving on.<x>table?" prompt appears.eql_v2_configurationdoes not appear in the table list.