Conversation
Contributor
Code Metrics Report
Details | | main (28388de) | #560 (54239f5) | +/- |
|---------------------|----------------|----------------|------|
| Coverage | 87.4% | 87.4% | 0.0% |
| Files | 204 | 204 | 0 |
| Lines | 6014 | 6014 | 0 |
| Covered | 5257 | 5257 | 0 |
- | Test Execution Time | 2m13s | 2m21s | +8s |Reported by octocov |
Decision record for building inline cell editing into DataTable: typing
into cells with rules (whole numbers, min/max, decimal limits), per-row
editability via canEdit(row, { selected }), keyboard entry, and autosave
on leave with revert on failure, across every built-in column type.
Open for team input; no package changes. Refs
tailor-inc/platform-planning#1750, tailor-inc/platform-planning#1428,
tailor-inc/platform-planning#1115.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pure helpers behind inline cell editing: which keystrokes a number cell accepts, how pasted or IME text is cleaned up, the rule order (required, number, decimals, min, max, custom), no-op equality (10 vs "10.00"), currency decimal places, and a focus registry so Enter / Tab can move between editable cells without querying the DOM. Refs tailor-inc/platform-planning#1750 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…k columns
Give a column an `edit` config and users can type straight into its
cells. The table never stores edits: `edit.onCommit(row, value)` runs
when the user leaves the cell (or presses Enter / Tab) with a changed
value that passes every rule, and the consumer updates `data`.
- Rules: `min`, `max`, `maxDecimals`, `required`, `validate`. Characters
that can never be valid are blocked as typed; other errors show a red
outline and a tooltip; Enter / Tab are blocked until fixed, Esc
reverts, and leaving an invalid cell reverts it.
- Per-row control: `canEdit(row, { selected })`.
- Keyboard: Enter moves down the column, Tab to the next editable cell;
IME composition is respected.
- Autosave: a promise returned from `onCommit` keeps the new value on
screen while pending and reverts the cell if it rejects.
- The editor overlays the cell's normal content, so row height and
column width never change. Number/money cells display as many
decimals as their editor accepts.
Refs tailor-inc/platform-planning#1750
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- docs-src: new "Inline editing" section on the DataTable page (options, rules and errors, keyboard, saving, limits) and an `edit` column in the per-type field table; docs regenerated with `pnpm docs:sync`. - list-dense-scan pattern: replace "no inline editable cells" with an inline-entry variant and guidance on when to use detail/form instead. - vite example: goods-receipt table in the DataTable lab (received qty gated by selection, autosaving unit price with a failing save, notes, supplier link). - Decision record: note that PR 1's scope is implemented here. Refs tailor-inc/platform-planning#1750 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every typed column can now be edited in place: - `text` / `link` with `edit.options`: a dropdown of choices. The column stores a choice's value and every cell shows its label. - `badge`: a dropdown whose choices are the same badges; defaults to the entries of `typeOptions.badgeLabelMap`, else the enum filter options. - `date`: a calendar popover (plus a time field for `datetime`), with `min` / `max` bounds and Clear unless `required`. Picks commit straight away through the same `onCommit` / pending / revert path as typed cells; `validate` can reject a pick with a tooltip. Tab moves between all editable cells. Also: - Date-only "YYYY-MM-DD" values now render as that day in every time zone (they showed the previous day west of UTC). - Navigation no longer relies on ref cleanups, which `Input` and `Select.Trigger` drop since #559 merged their refs; cells that left the page are skipped. - Docs, demo (supplier dropdown, status badge dropdown, expected date) and changeset updated. Refs tailor-inc/platform-planning#1750 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Date-only values: one parser for display and editing (cell-edit's
`toLocalDate`), which also rejects impossible days — "2026-13-45" no
longer rolls over into a real date.
- Date trigger: its accessible name now carries the current date
("Expected, Oct 2, 2026"); the visible date is hidden from AT.
- Badge columns: a cell holding several values stays read-only rather
than having its list replaced by a single pick.
- Unit tests for the choice and date helpers.
- Demo: plausible supplier names.
Refs tailor-inc/platform-planning#1750
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Editable cells now look exactly like the rest of the table: - No input boxes or outlines at rest. Each editor covers its whole cell, edge to edge (inheriting the cell's padding so text lines up), so a click anywhere in the cell starts editing. - The cursor says what a click does: a text cursor over typing cells, a pointer over dropdown and date cells, and "not allowed" over every read-only cell in a table that has editable columns (unless rows are clickable). - The cell being edited outlines its edges with a 2px inset primary ring; dropdown chevrons and calendar icons appear on hover, focus and while open, so they never cover text at rest. Refs tailor-inc/platform-planning#1750 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A date column with `edit.min` / `edit.max` opened an empty cell's calendar on today's month even when every day in it was disabled. It now opens on the nearest day that can be picked. Refs tailor-inc/platform-planning#1750 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds Warehouse (optional dropdown), Discount % (number limited to 0–100, one decimal), Weight (three decimals, max 500), Lot no. (required text), Received at (date-time), Best before (date bounded to Oct 2026–Dec 2027) and QC (optional badge dropdown). Total now applies the discount. Refs tailor-inc/platform-planning#1750 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A dropdown chevron or calendar icon drew over the end of a long value. Dropdown and date cells now keep a 20px space at their right edge for the icon, so a value ends (or truncates) before it. Read-only cells of the same column keep the space too, so the column's width doesn't shift as rows become editable or not. Refs tailor-inc/platform-planning#1750 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Select popup had no inner padding, so a highlighted option touched its edges. It now has the same 4px inset as Menu, Combobox and Autocomplete. Refs tailor-inc/platform-planning#1750 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
itsprade
force-pushed
the
feat/core/1750-datatable-inline-edit
branch
from
September 29, 2026 12:08
581b087 to
e7b094f
Compare
The "For the call" list still asked whether to ship in two PRs. Date and badge editing are already in this one, so the question is now whether reviewing them together is OK. Refs tailor-inc/platform-planning#1750 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds inline cell editing to
DataTablefor every typed column, together with the decision record that proposes it (decisions/data-table-inline-editing.md). It's still a draft for team input: the "For the call" questions in the decision doc are open. Date and badge editing, first planned as a follow-up PR, are folded in, so the whole feature can be tried and reviewed at once.Why
What's in it
An
editconfig on typed columns:text,number,money,linktext/linkwithedit.optionsbadgebadgeLabelMap)datedateFormat: "datetime"adds a time fieldmin,max,maxDecimalsandrequired, plusvalidate(value, row)for any rule of the screen's own. Date columns takemin/maxdays.canEdit(row, { selected }).onCommitreturns a promise, the cell keeps the new value while it's pending and reverts if it rejects. There's no saving indicator.Compatibility
useDataTableoptions andDataTableContextValueare unchanged, and columns withouteditbehave as before."YYYY-MM-DD"value shows that day in every time zone. It rendered a day early west of UTC.edit.maxDecimalsdecimals, and amaxDecimalsbelowminDecimalsno longer throws.Select: its dropdown gets the same 4px inner padding asMenu,ComboboxandAutocomplete, so the highlighted option no longer touches the edges. It's a separate commit with its ownpatchchangeset, easy to split out if preferred.Also included
docs-src/and regenerated withpnpm docs:sync.list-dense-scanpattern: its "no inline editable cells" rule is replaced with guidance.minor(inline editing) andpatch(Selectpadding).Not in this PR
validatefor server checks with an in-cell message, and schema-based rules (e.g. Zod)Try it
pnpm dev, then open/showcase/data-table-lab→ Inline editing:Test plan
pnpm type-check,pnpm lint,pnpm test(1,901 core tests, 82 of them new),check-dts,pnpm fmt:check,pnpm docs:checkFor reviewers
The open questions, with details in the decision doc:
edit/canEdit/onCommit, or Base UI'sonValueCommittedwording?useOptimisticRowsbuild on it later?docs-src/patterns/and retire the popover version?Selectpadding: keep it here, or split it into its own PR?Refs tailor-inc/platform-planning#1750 · tailor-inc/platform-planning#1428 · tailor-inc/platform-planning#1115 · tailor-inc/platform-planning#1161
🤖 Generated with Claude Code