Skip to content

feat: write one table cell by row and column, confirmed by reading the table again - #92

Merged
iamnbutler merged 1 commit into
mainfrom
feat/set-cell
Oct 17, 2026
Merged

iamnbutler merged 1 commit into
mainfrom
feat/set-cell

Conversation

@iamnbutler

Copy link
Copy Markdown
Contributor

Table cell edit (from 73's list). Builds on #86's table read.

desktop_set_cell takes pid, window, the scope snapshot, the table scope element, the row's element ID from a desktop_read table read, a column (exact title or 0-based index) and a value.

  1. Reads the table with that snapshot and finds the cell's first editable control.
  2. Writes the control:
  3. Reads the table again with the same snapshot. Peekaboo keeps a consumed snapshot readable ("Read-only snapshot inspection is still available").
  4. Compares the cell at the same row position and column.
    • completed only when the control reads back the value and the row's other cells are unchanged.
    • Otherwise unknown, with cell.readback: differs, row_changed (for example, Finder re-sorting after a rename) or unreadable.
  • A refused or unknown write keeps its outcome.

Refused before any input:

  • cells with only text (such as Numbers and Excel, CELL_NOT_EDITABLE), with a hint pointing to a new recipe
  • a control the snapshot didn't store (CELL_NOT_IN_SNAPSHOT)
  • unknown, ambiguous or out-of-range columns
  • an unknown row ID
  • a boolean written to a text control

Code

  • table.ts: the layout is factored out of buildTable, with no behavior change; the existing table tests pass. Adds locateCell.
  • cell.ts: composes the reads and the action through injected IO, like notification actions.
  • No native changes.

Docs

  • tools.md: a row and a section for the new tool.
  • New recipe "Edit a spreadsheet cell": click the cell, type with insert, press Return, then read again. Marked unverified.

Tests

  • test/cell.test.mjs, against the Finder and Numbers fixtures plus a synthetic checkbox grid:
    • matched, differs, row_changed and unreadable readbacks
    • refused and unknown writes passed through
    • each pre-input refusal
    • the set-value route
  • npm test: 38 pass. npm run check is clean.

Live checks: pending, screen locked. Finder rename, a web grid, and whether Numbers or Excel expose cell controls. I'll add these to #42.

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