pf_app
Go to file
Paul Trowbridge 099925b121 Drag to select a region, and show the selection on the grid
Two gaps in how the pivot reports a selection. Dragging across cells did
nothing, and a selection built from several ctrl-clicks was invisible on
the grid — the panel listed the slices but nothing on screen said which
cells they came from.

Drag-select
- The perspective-select handler was reading detail.selected and
  detail.insertConfigs. In 5.2.0 that event carries a ViewWindow —
  { start_row, end_row, start_col, end_col }; insertConfigs only appears
  on perspective-global-filter, and only in SELECT_ROW_TREE mode. So the
  handler always returned early and the whole path was dead.
- It fires on every mouseover as the region grows, so the handler now
  records the latest window and a window-level mouseup commits it. A
  single-cell region is skipped there: perspective-click already owns
  plain and modifier clicks, and handling it in both places would undo a
  ctrl-click toggle. Modifier+drag adds to the selection.
- Turning a region back into slices re-derives, per cell, the same
  filters Perspective attaches to a click — row dimensions from the
  view's __ROW_PATH__, column dimensions from the split_by segments of
  the column name. Reading the path rather than the rendered cell is
  what keeps dates as epoch millis instead of whatever the grid
  formatted them as. The grand-total row resolves to no dimension at
  all — that would mean the whole version — and is skipped.

Highlight
- The datagrid already highlights whatever sits in its own
  model._selection_state.selected_areas, and wipes that list on every
  mousedown, so a multi-click selection only ever showed the last cell.
  Keep a sliceKey -> rectangles map parallel to `slices` and push the
  full set back after each change, which gets the native highlight for
  every selected cell without any styling of our own.
- Deselecting anywhere — ctrl-click, the panel's x, Clear selection —
  prunes the map by live slice key, so the grid and the panel cannot
  disagree.

Also: edit_mode is forced to SELECT_REGION on restore rather than
defaulted, since a saved layout's plugin_config could previously
override it and turn selection off entirely.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LoxNi8cFsQLPUSw3obb5NH
2026-09-12 08:51:14 -04:00
lib Multi-slice operations, tagged bridge, and a reworked adjustment panel 2026-09-11 23:30:56 -04:00
public Add UX mockup and update spec with navigation direction 2026-04-25 14:56:29 -04:00
routes Multi-slice operations, tagged bridge, and a reworked adjustment panel 2026-09-11 23:30:56 -04:00
setup_sql Multi-slice operations, tagged bridge, and a reworked adjustment panel 2026-09-11 23:30:56 -04:00
ui Drag to select a region, and show the selection on the grid 2026-09-12 08:51:14 -04:00
.env.example Initial commit — pivot forecast application 2026-04-01 07:59:05 -04:00
.gitignore Scaffold React/Vite/Tailwind UI with 3-step Setup → Baseline → Forecast flow 2026-04-25 16:28:45 -04:00
CLAUDE.md Drag to select a region, and show the selection on the grid 2026-09-12 08:51:14 -04:00
install.sh Initial commit — pivot forecast application 2026-04-01 07:59:05 -04:00
package-lock.json Fix forecast data load and add byte-progress UI 2026-04-28 19:51:39 -04:00
package.json Add CLAUDE.md project instructions and license field to package.json 2026-05-02 20:47:15 -04:00
PERSPECTIVE.md Load Perspective from bundle, not CDN; pin all packages at 5.2.0 2026-08-17 21:30:19 -04:00
pf_perspective_options.md Document Perspective architecture options 2026-04-28 20:21:19 -04:00
pf_spec.md Update spec and CLAUDE.md for multi-slice, tags, and the bridge 2026-09-11 23:34:08 -04:00
pf_ux_mockup.md Add UX mockup and update spec with navigation direction 2026-04-25 14:56:29 -04:00
pf.sh Add pf.sh — interactive deployment and service management script 2026-05-02 20:58:39 -04:00
server.js Fix forecast data load and add byte-progress UI 2026-04-28 19:51:39 -04:00