Skip to content

Doc screenshots: generator + captured shots#2

Draft
asg017 wants to merge 4 commits into
asg017/sharing-v2from
asg017/sheets-screenshots
Draft

Doc screenshots: generator + captured shots#2
asg017 wants to merge 4 commits into
asg017/sharing-v2from
asg017/sheets-screenshots

Conversation

@asg017

@asg017 asg017 commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #1 (sharing-v2). Adds the documentation screenshot tooling and captured shots.

Commits

  • Add doc screenshot generator (scripts/screenshots.mjs) + docs/screenshots
  • More screenshots (formula editing, autocomplete, tabs, named ranges) + gotham dev sharing demo
  • Fix sidebar/vite version clash + tighten screenshot viewport
  • Fix share dialog grant-list (resources_sql → acl_resources) + add share shot

Base is asg017/sharing-v2 so this diff shows only the screenshot work. Rebase onto main once #1 merges.

🤖 Generated with Claude Code

asg017 and others added 4 commits June 23, 2026 14:30
…hots

Self-contained Playwright screenshot system, modelled on datasette-paper's
`shots`: `just shots` boots a throwaway Datasette (fresh internal + data DB),
lets a throwaway plugins-dir plugin seed a demo "Q3 Revenue Plan" workbook
(values, SUM formulas, currency/bold formatting) plus alice/bob/grace acl
grants and friendly actor names, drives a headless browser, then tears it down.

Three committed shots in docs/screenshots/, embedded in the README:
- workbook-list — the per-database workbook index
- editor — the grid with formulas, currency/bold formatting, sheet tabs
- collaboration — alice's window with bob + grace present live over SSE
  (remote cursors, name labels, avatar strip), the headline feature on top of
  sharing-v2

Determinism: server pinned to PYTHONHASHSEED=0 (stable presence colours),
volatile timestamps frozen, a stability stylesheet hides the caret/transitions
and the dev-only datasette-debug-bar panel — so a re-run with no UI change
produces no binary diff.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…+ gotham dev sharing demo

Screenshots:
- formula-editing — live signature-help tooltip + coloured highlight of the
  referenced range while typing =SUM(B2:B5
- autocomplete — merged suggestion list (built-in functions + the sheet's named
  ranges, e.g. TaxRate) on =T
- sheet-tabs — the per-tab management menu (rename / colour / move / delete),
  captured as a padded union of the tab bar + its body-appended context menu
- named-ranges — the Named ranges panel listing seeded ranges + a scalar
The seed plugin now defines Q1Revenue / Q2Revenue / TaxRate on the Forecast
sheet so the named-ranges + autocomplete shots have content. A shotUnion()
helper (from datasette-paper) frames features with detached floating UI.

just dev: adopt the sibling-plugin (places / kanban / acl) gotham sharing-demo
pattern — load demo actors via datasette-debug-gotham, map each newsroom to an
acl dynamic-group, and wire Bruce Wayne as the global acl admin, so per-workbook
sharing is demoable locally by switching users. (Pre-existing, unrelated: the
workbook *list* page 500s under `just dev` because datasette-sidebar passes a
vite_dev_path kwarg the installed datasette-vite rejects — a dev-dep version
mismatch, not touched here. Sheets pages themselves render fine.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Bump datasette-sidebar to >=0.0.1a3 (dev dep). a1/a2 call
  vite_css_urls(..., vite_dev_path=...), a kwarg datasette-vite>=0.0.1a4 (a hard
  dep) no longer accepts, which 500'd every page rendering the sidebar — incl.
  the workbook list under `just dev`. a3 drops the kwarg. `just dev` list +
  /-/plugins now 200.

- Screenshots: drop the viewport from 1280x820 to 900x560 (autocomplete uses a
  taller 760 so its dropdown isn't clipped). The demo data only fills A–D, so
  the wide shots wasted space on empty columns A–L and ~20 empty rows; 900 is
  the narrowest width that still shows the full toolbar (A–H now). makeContext()
  takes an optional viewport for the tall variant. All 7 shots regenerated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…re shot

The <datasette-acl-share-dialog> people list 403'd for everyone, including the
owner: acl's read API gates on resource_exists, which runs the resource type's
resources_sql against the internal DB. Sheets' workbooks live in *user* DBs, so
SheetsWorkbookResource.resources_sql was stubbed to return nothing → every
workbook read as non-existent. (Sibling plugins like places/kanban work because
their resources live in the internal DB.)

Fix: enumerate from acl's own internal acl_resources table —
  SELECT parent, child FROM acl_resources WHERE resource_type = 'sheets-workbook'
Every workbook created through the normal flow seeds a creator Manager grant,
which upserts an acl_resources row, so existence resolves correctly. resources_sql
is an @AbstractMethod, so it can't be dropped, and acl deliberately doesn't fall
back to its own tables (issue #43) — this delegates to that table explicitly.

- tests/test_share_and_presence.py: end-to-end coverage of the acl read API
  (manager sees grants; non-manager 403s) + resource_exists, the gap that let
  this slip (existing tests only exercised grant()/list_grants directly).
- screenshots: add the `share` shot back. The demo plugin's actors_from_ids now
  sets display_name (acl's read API reads that, not name) and uses tryfirst to
  win the firstresult race vs datasette-debug-gotham, so the dialog shows real
  names (Alice Ada / Bob Babbage / Grace Hopper) with their roles.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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