feat: inline cell editing (v1) with async edit lifecycle#174
Merged
Conversation
Controlled onCellEdit data flow; the edit lifecycle (checking → editing → validating → saving, with invalid/error branches) lives as sync transitions in @pretable/core (snapshot.editing) while the React surface orchestrates the async hooks (editable/validate/commit, all Promise-capable). Single-cell scope for v1; fill/paste/multi-cell/optimistic/undo deferred.
9-task TDD plan: edit-lifecycle types + sync state machine in grid-core (snapshot.editing); public surface on @pretable/core; async orchestrator (useCellEditController) with staleness token; default CellEditor + renderEditor; wire triggers/editor/onCellEdit into PretableSurface; surface through <Pretable>; docs page; full verification incl. api:check regen.
…) + column hooks + snapshot.editing
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…EditorInput Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fixes a no-unused-vars lint error that would fail the required repo-lint CI gate. The helper was never wired into any test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… render, onCellEdit) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Arrow keys, Home/End, PageUp/Down, and Cmd+A pressed inside the cell editor input bubbled to the grid's onKeyDown and moved focus/selection underneath the open editor. CellEditor only stop-propagates Enter/Tab/Escape. Bail out of the grid keydown handler whenever an edit is active so the editor owns the keyboard; add a regression test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Vercel preview readyPreview: https://pretable-2atyphuuy-cacheplane.vercel.app Updated automatically by the |
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.
Adds inline cell editing — the largest table-stakes gap for a "drop-in React data grid" (from the v1 gap assessment). Built spec → plan → subagent execution with two-stage (spec + quality) review per unit.
Spec:
docs/superpowers/specs/2026-06-08-cell-editing-design.md· Plan:docs/superpowers/plans/2026-06-08-cell-editing.mdWhat it does
onCellEdit({ rowId, columnId, value, row }); the app updates its ownrows. No internal row mutation.onCellEditis a prop on<Pretable>and<PretableSurface>.editable,validate, and commit may each bePromise-returning. Phases (checking → editing → validating → saving, plusinvalid/error) are modeled as sync transitions in@pretable/core(snapshot.editing.status); the React surface drives the async hooks viauseCellEditController, guarding stale resolutions with a monotonic token.editable?: boolean | (input) => boolean | Promise<boolean>,validate?: (value, input) => (true|string) | Promise<…>,renderEditor?,parseEditValue?/formatEditValue?.renderEditorescape hatch. Begin: Enter / F2 / double-click / type-to-replace (on editable cells only). Commit: Enter → down, Tab → right. Cancel: Escape. Editor owns keystrokes while active (grid nav/selection correctly suspended).snapshot.editing+ thebeginEdit/commitEditSucceeded/… transitions./docs/grid/editingpage + nav entry.Scope (v1)
In: the full async lifecycle, default + custom editors, parse/format, triggers, pessimistic commit. Out (follow-ups): drag-fill, paste-into-range, multi-cell editing, optimistic commit, undo.
Verification
All gates green locally: package tests (grid-core 84, react 225, +others), repo
typecheck/lint/format,api:check(core + react reports regenerated), websitebuild(editing route in the search index). An independent final review cleared it READY TO MERGE; a keyboard-nav-leak bug found mid-review was fixed (67f5ccb).Known v1 follow-ups (filed separately, non-blocking)
validate/commit error messages or pending affordance (the data is insnapshot.editing.error/.status+ adata-pretable-edit-statushook for consumers; default React UX + ARIA polish is a follow-up).🤖 Generated with Claude Code