Skip to content

feat(html): the viewer states whether a click opens a sheet cell - #912

Merged
andiwand merged 2 commits into
mainfrom
feat/the-viewer-states-the-sheet-gesture
Sep 20, 2026
Merged

andiwand merged 2 commits into
mainfrom
feat/the-viewer-states-the-sheet-gesture

Conversation

@andiwand

@andiwand andiwand commented Sep 20, 2026

Copy link
Copy Markdown
Member

Follow-up to #908, which asks the pointer whether a click edits. The pointer is a guess, and it is wrong where it matters: an android WebView reports (pointer: coarse) as false on an emulator, so the tap-to-edit that PR is for did not happen there at all - measured on a Pixel 6 Pro AVD, matchMedia("(pointer: coarse)").matches === false with editing enabled and a tap landing on the cell.

The viewer knows its input model; the library is guessing at it. So odr.editing.setSheetOptions({editOnClick}) states it, the way odr.annotation.setOptions already states the marking gestures. Unstated (null), the pointer answers exactly as it does today, so nothing changes for a viewer that says nothing.

odr.editing.setSheetOptions({ editOnClick: true });   // a phone app
odr.editing.getSheetOptions();                        // {editOnClick: true}
odr.editing.setSheetOptions({ nope: 1 });             // throws

Checked

test/browser/sheet/editing.html: 77 checks, none failing, seven of them new - the default asks the pointer, stated off a click opens nothing while the double click still works, stated on one click opens the cell with its text and pins it, and an unknown option throws.

The pointer decides whether a click opens a cell's editor, and it is a
guess: an android WebView reports `(pointer: coarse)` as false on an
emulator, so the tap-to-edit of #908 did not happen there at all.

`odr.editing.setSheetOptions({editOnClick})` lets the viewer state it,
as `odr.annotation.setOptions` states the marking gestures. Unstated,
the pointer answers as before.

Checked with `test/browser/sheet` - 77 checks on the editing page, none
failing, seven of them new.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FJJdfqpnVCKBNHXjAVxSou
@andiwand
andiwand force-pushed the feat/the-viewer-states-the-sheet-gesture branch from c38ab42 to cf8e01c Compare September 20, 2026 09:53
…g as off

`setSheetOptions({editOnClick: undefined})` set the key, so `!== null` took it
as a stated no and a tap opened nothing. `!= null` reads both null and
undefined as unstated, which is what a host passing a value it does not have
means.

The design doc said a double click is what opens the editor, which #908 and
this one no longer make true.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0149gFxhkvKTBQidz6brU8Vt
@andiwand
andiwand merged commit 8b93e89 into main Sep 20, 2026
17 checks passed
@andiwand
andiwand deleted the feat/the-viewer-states-the-sheet-gesture branch September 20, 2026 09:58
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