Commit Graph

1131 Commits

Author SHA1 Message Date
Philipinho 731fa45672 chore(db): drop Base entity type aliases (table no longer exists) 2026-04-27 01:04:05 +01:00
Philipinho 2b05d1520b chore(db): regenerate Kysely types after bases-as-pages migration 2026-04-27 01:01:41 +01:00
Philipinho 24a70e48da fix(db): add pending_type columns to recreated base_properties table 2026-04-27 00:59:36 +01:00
Philipinho a847c2121c feat(db): add is_base flag to pages, drop bases table, recreate base_* with page_id 2026-04-27 00:53:44 +01:00
Philipinho 137c02a10f feat(base): sticky table header so columns stay visible while scrolling
Pins the header row to the top of the gridWrapper scroll viewport, with
the pinned-left corner cell stacking above pinned body cells at the
top-left intersection. The trailing add-column button gets the same
sticky treatment so it doesn't drift away from the row.

Subtle bit: `position: sticky` confines an element to its containing
block. The previous subgrid `.headerRow` wrapper was 34px tall, so
sticky cells could only travel 34px before scrolling out with the
wrapper. Switching the wrapper to `display: contents` lets the cells
become direct grid children of `.grid` (full table height) so sticky
travel matches the scroll range. role="row" survives display:contents
in modern browsers.
2026-04-25 01:05:20 +01:00
Philipinho be79b7159c feat(base): warm row count query on base load, gated on user hydrate
Mounts useBaseRowsCountQuery alongside the rows query so the count is
fetched eagerly and the cache is warm by the time the toolbar consumes
it. Gating on `currentUser` (not just `base`) ensures the persisted
view-draft has hydrated from localStorage before the first count fires
— otherwise a post-refresh count races ahead of the user's saved
filter and ships without it.
2026-04-25 01:05:11 +01:00
Philipinho 18222d1142 fix(base): escalate fuzzy filter and search counts to capped-exact
Postgres has no per-expression stats for `cells->>'uuid' ILIKE '%…%'`,
`search_text ILIKE`, or `search_tsv @@`, so EXPLAIN Plan Rows falls
back to a default selectivity and is off by orders of magnitude — a
contains filter on a 10k-row base was reporting ~150 against thousands
of real matches. Auto-route any request whose filter tree contains a
contains/ncontains/startsWith/endsWith op or a search term to the
capped-exact path, even when the caller asked for an estimate.
2026-04-25 01:05:02 +01:00
Philipinho 72fc93dcc1 perf(base): batch page-cell resolution via microtask loader
Per-cell useResolvedPages([id]) calls each mounted with a unique
React Query key, so a grid with 20 page-typed cells fired 20 requests on
first paint. A shared loader now accumulates incoming ids within a
microtask, fires a single POST for the union, and fans the subset each
caller asked for back to them. Cells keep their own cache entry + null
handling; they just share the underlying network call.

Also renames /bases/pages/resolve → /bases/pages/expand — the old name
collided with other "resolve" semantics in the codebase.
2026-04-24 12:11:41 +01:00
Philipinho 89ee3714ac feat(base): add /bases/rows/count with estimate and capped-exact modes
Row-count display on a filtered view shouldn't force a full COUNT(*) on
every list fetch. New endpoint returns either an EXPLAIN-plan estimate
(default, ~1ms, no execution) or a LIMIT-capped exact count that short-
circuits to `{ capped: true }` once the match set passes EXACT_COUNT_CAP.
Clients call it in parallel with the rows query so the grid still paints
at its own pace.

- DTO + repo.countEstimate/countExact reusing the list predicate shape
- service picks the mode; controller mirrors the list Read ability check
- client hook keyed by filter/search/exact so a "show exact" toggle
  doesn't clobber the estimate cache
2026-04-24 12:11:29 +01:00
Philipinho b9d8bf948c fix(base): strip empty filter groups at the query boundary
The view-draft layer stores `{op: 'and', children: []}` as an explicit
"override baseline with no predicates" marker. That payload was leaking
into /bases/rows requests once local filter/sort drafts were enabled —
harmless server-side (buildWhere maps an empty group to TRUE) but it
destabilised the React Query key and cluttered request payloads. Normalise
empty groups to undefined at the hook level.
2026-04-24 12:11:02 +01:00
Philipinho f7ea6e8fd3 fix(base): hide soft-deleted properties from base info payload
The withProperties subquery hydrating /bases/info was missing a
`deleted_at IS NULL` filter, so after a delete the socket-echo
invalidation refetched and the just-deleted column rehydrated on the
originating client and never dropped on others.
2026-04-24 12:10:22 +01:00
Philipinho dcff8d3c53 fix(base): mirror filter-clear fix for sorts so deleting the last sort sticks 2026-04-24 03:04:51 +01:00
Philipinho 2db43788d5 feat(base): auto-suffix fallback property names to avoid collisions 2026-04-24 02:54:03 +01:00
Philipinho 3bfdae7990 feat(base): insert palette items at cursor and refocus editor 2026-04-24 02:47:12 +01:00
Philipinho 464bd701ba feat(base): enforce unique property names per base 2026-04-24 02:34:38 +01:00
Philipinho 8c0071ee23 fix(base-formula): point client exports at source so Vite can detect ESM named exports 2026-04-24 02:28:23 +01:00
Philipinho 3962ccdc29 feat(base): tighten formula editor spacing and pill styling 2026-04-24 02:25:33 +01:00
Philipinho 7a254a9412 feat(base): redesign formula editor popover with polished header, pills, and accordion 2026-04-24 02:15:08 +01:00
Philipinho 9808791db4 feat(base-formula): add add/subtract/multiply/divide/pow/sqrt/sum/mean/median functions 2026-04-24 02:10:23 +01:00
Philipinho f99450f04a fix formula 2026-04-24 01:33:14 +01:00
Philipinho 82705ce3bd fix(base-formula): resolve package via dist to keep server build output layout 2026-04-24 00:51:40 +01:00
Philipinho 3eb7c9b1d4 feat(base): render formula cells with error badge support 2026-04-24 00:35:57 +01:00
Philipinho 28fed815ba feat(base): add formula editor popover with live parse and palette 2026-04-24 00:35:26 +01:00
Philipinho 48d77a2b53 feat(base): add Formula entry to the property type picker 2026-04-24 00:33:38 +01:00
Philipinho 46f9292c05 feat(base): subscribe to formula WS events on client 2026-04-24 00:29:23 +01:00
Philipinho 230c4e35f0 feat(base): emit formula-related WS events 2026-04-24 00:27:52 +01:00
Philipinho e729e77bda chore(base): note formula bulk-write threshold hook for future bulk endpoint 2026-04-24 00:27:06 +01:00
Philipinho 89e2d0d62f feat(base): compile and cycle-check formulas on property save, enqueue recompute on dep changes 2026-04-24 00:25:50 +01:00
Philipinho fbee344e96 feat(base): wire formula recompute job into queue processor 2026-04-24 00:21:20 +01:00
Philipinho 46386bf4e1 feat(base): add formula recompute task 2026-04-24 00:20:25 +01:00
Philipinho 5b5c98daa8 feat(base): wire inline formula evaluation into row service 2026-04-24 00:16:32 +01:00
Philipinho 2da8779b34 feat(base): add FormulaService, FormulaLockService, recompute job type 2026-04-24 00:13:20 +01:00
Philipinho 493613e634 feat(base): add client formula type literals 2026-04-24 00:07:17 +01:00
Philipinho 5a82d660da feat(base): register formula property type in schema layer 2026-04-24 00:06:42 +01:00
Philipinho c67ae19c39 feat(base): add migration marker for formula property type 2026-04-24 00:06:13 +01:00
Philipinho ea0dc2b56b feat(base-formula): add date and coercion functions, wire registry 2026-04-24 00:03:40 +01:00
Philipinho 0174fada5f feat(base-formula): add string and coercion functions 2026-04-24 00:02:40 +01:00
Philipinho 6669832e24 feat(base-formula): add math functions 2026-04-24 00:02:26 +01:00
Philipinho 22716f3df9 feat(base-formula): add logic functions 2026-04-24 00:02:15 +01:00
Philipinho e9e903abe9 feat(base-formula): add tree-walking evaluator 2026-04-24 00:00:22 +01:00
Philipinho 1b30de32b5 feat(base-formula): add function registry register helper 2026-04-23 23:56:48 +01:00
Philipinho ded855e44e feat(base-formula): add dependency graph with topo and cycle detection 2026-04-23 23:55:55 +01:00
Philipinho e445fc4fa9 feat(base-formula): add pretty-printer 2026-04-23 23:53:41 +01:00
Philipinho 77897733de feat(base-formula): add type checker 2026-04-23 23:52:11 +01:00
Philipinho 216a4a99e1 feat(base-formula): add name-to-id resolver with dependency extraction 2026-04-23 23:46:52 +01:00
Philipinho d8c96089b1 feat(base-formula): add Pratt parser 2026-04-23 23:44:09 +01:00
Philipinho dc825b0f62 feat(base-formula): add tokenizer 2026-04-23 23:40:14 +01:00
Philipinho 7202e65a07 feat(base-formula): add parse-error and cell-error sentinels 2026-04-23 23:34:05 +01:00
Philipinho 4c2d6772f1 feat(base-formula): add AST and value types 2026-04-23 23:26:49 +01:00
Philipinho a65aec0925 chore(base-formula): gitignore dist and tsbuildinfo to match editor-ext convention 2026-04-23 23:25:03 +01:00