Title: fix(tables): rework lock settings as Table Security and gate locked actions by j15z · Pull Request #7853 · simstudioai/sim · GitHub
Open Graph Title: fix(tables): rework lock settings as Table Security and gate locked actions by j15z · Pull Request #7853 · simstudioai/sim
X Title: fix(tables): rework lock settings as Table Security and gate locked actions by j15z · Pull Request #7853 · simstudioai/sim
Description: Summary Replaces Lock settings with a Table Security modal, and makes a denied action explain itself where the user meets it instead of failing on save or doing nothing at all. Table Security modal: Deny / Allow rows for Inserting Rows, Updating Rows, Deleting Rows, and Changing Table Schema. The rows map one-to-one onto the existing four lock flags — Deny is a set lock — so an unconfigured table opens on four Allows and every viewer sees the same state. No backend or migration change. Changing Table Schema denied: New column keeps a lock icon, is aria-disabled, and explains itself in a tooltip. Edit column, Insert column left/right, and Delete column are all disabled with tooltips. Clicking a column header opens the config panel read-only — values stay readable and selectable, the controls are inert, and Save carries the reason. Hide column is untouched: hiding a workflow output is a metadata change no lock covers. Updating Rows denied: Double-click and Enter/F2 still open the cell editor, read-only, so values can be selected and copied. Text and number inputs are read-only, date cells hide the calendar, and select options are disabled. The expanded text editor opens read-only with Save disabled and the reason on hover; its footer hint no longer advertises ↵ save. Clicking a checkbox cell raises the same notice the keyboard paths already did, instead of silently doing nothing. An empty cell that can't be edited opens nothing (also applies to users without edit access). Inserting Rows denied: New row keeps a lock icon and tooltip; Insert row above/below and Duplicate row are disabled. New rows through the Add Row form: a blank row doesn't work when updates are denied (typing into it is an update) or when any column is required (the server rejects an empty row). In either case New row, Shift+Enter, and Insert row above/below open the Add Row form at that position, and the form inserts the complete row in one request. Row form: Add mode with an optional insert position; Add Row and Update Row stay disabled until every required field has a value. Values are read and written by column id. Before this, Edit Row showed empty fields and saved under the column name on columns that have an id. Only touched fields are sent, and in edit mode only changed ones, so an untouched empty column is no longer written as null and a no-op save closes without a write. Checkboxes are the exception on insert: they always carry a concrete boolean. A rejected write renders once, inline. Row mutations take an opt-in suppressErrorToast; the cache self-heal on a 423 still runs. Date columns use one date-and-time picker, matching the grid. Copy: notices speak the modal's Allow/Deny vocabulary and name the row that denies the action; tooltip strings live in lock-copy rather than at each call site. ChipDatePicker: follows InsideModalContext like ChipDropdown (#7435 missed it), so its calendar is clickable inside modals, including the document tags modal. Single mode gains showTime and timeLabel. Reviewer notes: Rows added through the Add Row form aren't added to the grid's undo history. A disabled Save doesn't say which required field is empty; required fields are marked with *. A new TTL value picked in the Add Row form saves with a -00:00 offset while date columns use the viewer's local offset. Existing behavior, left as is. Two pre-existing server bugs surfaced while testing and are deliberately out of scope: the metadata endpoint can strip a workflow group's dependencies on a schema-locked table, and unique values and row caps can be exceeded by parallel inserts. Tracked separately. Type of Change Bug fix New feature Breaking change Documentation Other: ___________ Testing Unit tests for: Table Security modal: always renders the four rows, starts an unconfigured table on Allow, mirrors server locks with Deny as a set lock, saves denied actions as locks, and keeps the modal open with the draft intact when the save fails. Locked New column trigger: stays focusable, shows its tooltip, and opens no menu. Expanded cell editor: read-only with Save disabled and the reason on hover, footer hint drops ↵ save while blocked, and saves normally when allowed. Inline editors: read-only text input, and a read-only date input without the calendar. Row form: add mode inserts once under column ids and at a requested position, Save stays disabled until required fields have values, edit mode reads and saves by column id, a no-op edit writes nothing, an insert omits untouched columns but still sends checkboxes, and expiration date and time edits keep their offset. type-check and lint pass; 607 tests across tables/[tableId] and hooks/queries pass. Exercised in the running app against a local database: Read-only column panel (typing leaves the value unchanged), tooltips on the disabled column-menu rows, the checkbox-cell notice, the reworded on-open notice, the modal without its switch, and a unique-violation error appearing only inside the form. Server enforcement, called directly: every row, column, upsert, CSV import, and archive path returns 423 on a denied action and changes nothing; only admins can change locks (403 otherwise), and a write-only user sees no Table Security entry. A lock set in another tab reaches an open grid within ~2s over SSE, and submitting an already-open Add Row form is then refused by the server with the reason shown inline. Scale: a 105k-row table pages 1,000 rows in ~90ms, virtualizes to ~47 rendered rows while scrolling, and lock toggles take 14–19ms. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA) Screenshots/Videos Before: After: 🤖 Generated with Claude Code
Open Graph Description: Summary Replaces Lock settings with a Table Security modal, and makes a denied action explain itself where the user meets it instead of failing on save or doing nothing at all. Table Security moda...
X Description: Summary Replaces Lock settings with a Table Security modal, and makes a denied action explain itself where the user meets it instead of failing on save or doing nothing at all. Table Security moda...
Opengraph URL: https://github.com/simstudioai/sim/pull/7853
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:c2cbfc75-a4c4-9763-9d9a-05304b5fa8e0 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8668:138436:4F13B8:715A68:6AFB3C85 |
| html-safe-nonce | 4c7ba94acc8781fd9fa6d2d51df00c4d4d13bf8288a36a92d05c900ee5bc4728 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NjY4OjEzODQzNjo0RjEzQjg6NzE1QTY4OjZBRkIzQzg1IiwidmlzaXRvcl9pZCI6IjU3ODg5NTY1MTQ3Njg4NjIzNDEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 51ab53f3064faf836901b2155515dbf80321d4f145850afd1977bf6fdd99c68b |
| hovercard-subject-tag | pull_request:4539674641 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/7853/files |
| twitter:image | https://avatars.githubusercontent.com/u/96924014?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/96924014?s=400&v=4 |
| og:image:alt | Summary Replaces Lock settings with a Table Security modal, and makes a denied action explain itself where the user meets it instead of failing on save or doing nothing at all. Table Security moda... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2169b0dfbef67ed6b128074a5ed45bb7d5d1859783b10178b09a7765ad5f3693 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3b4fc8df5ef1c6757e733a23e6b81b6725021823 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width