Commit Graph

570 Commits

Author SHA1 Message Date
Philipinho adae526627 fix type 2026-04-27 02:12:34 +01:00
Philipinho e66e18cd60 fix(base): rename remaining baseId references in attachment upload and ws utility 2026-04-27 01:57:18 +01:00
Philipinho 3826e5a50d feat(base): add /bases/inline-embed endpoint that creates a child base page 2026-04-27 01:54:00 +01:00
Philipinho 19821d3aeb feat(base): page renderer dispatches to base view when page.isBase
- Add isBase to page repo baseFields so it is always selected
- Add isBase to sidebar pages query select list
- Add isBase to client IPage type
- In PageContent, render <BaseTable pageId={page.id} /> when page.isBase
  is true instead of the TipTap editor path
2026-04-27 01:49:54 +01:00
Philipinho 25dfb44774 refactor(base): rename baseId to pageId across WS, processors, tasks, formula, events
Renames baseId → pageId in:
- Domain event types (BaseEventBase) and all derived event types
- WS Zod schemas (wire-protocol field names now emit pageId)
- BaseWsService, BaseWsConsumers, BasePresenceService
- FormulaLockService, FormulaService
- BullMQ job interfaces (IBaseTypeConversionJob, IBaseCellGcJob, IBaseFormulaRecomputeJob)
- BaseQueueProcessor and all task functions
- Service emit-payload keys in base.service, base-property.service,
  base-row.service, base-view.service, base-csv-export.service
- Formula spec test fixtures
2026-04-27 01:38:11 +01:00
Philipinho 78d450a238 refactor(base): use PageAccessService for BaseViewController 2026-04-27 01:29:23 +01:00
Philipinho 2e7fe5bbb4 refactor(base): use PageAccessService for BaseRowController 2026-04-27 01:28:59 +01:00
Philipinho 43cf1665f5 refactor(base): use PageAccessService for BasePropertyController 2026-04-27 01:28:28 +01:00
Philipinho fd6a208235 refactor(base): use PageAccessService for BaseController permissions 2026-04-27 01:28:03 +01:00
Philipinho a53dabae70 refactor(base): rename baseId to pageId in DTOs, schemas, and services 2026-04-27 01:27:10 +01:00
Philipinho 54de3a7791 refactor(base): update task files to use renamed repo methods 2026-04-27 01:22:09 +01:00
Philipinho 16161d793b refactor(base): rename baseId to pageId in csv-export and page-resolver services 2026-04-27 01:21:07 +01:00
Philipinho 42f950e11d refactor(base): rename baseId to pageId in BaseViewService 2026-04-27 01:20:34 +01:00
Philipinho fdb250bbe8 refactor(base): rename baseId to pageId in BaseRowService 2026-04-27 01:19:49 +01:00
Philipinho 2b4a9b8a00 refactor(base): rename baseId methods to pageId in repos and BasePropertyService 2026-04-27 01:18:32 +01:00
Philipinho a2917bad6d feat(base): create() now allocates an is_base=true page via PageService 2026-04-27 01:16:48 +01:00
Philipinho ccdf2343f2 refactor(base): rename baseId to pageId in BaseViewRepo 2026-04-27 01:10:56 +01:00
Philipinho cbed118c11 refactor(base): rename baseId to pageId in BaseRowRepo 2026-04-27 01:10:29 +01:00
Philipinho 0f9dee4b28 refactor(base): rename baseId to pageId in BasePropertyRepo 2026-04-27 01:08:59 +01:00
Philipinho 0257f03003 refactor(base): rewrite BaseRepo over pages (is_base + base_schema_version) 2026-04-27 01:06:19 +01:00
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 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 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 464bd701ba feat(base): enforce unique property names per base 2026-04-24 02:34:38 +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 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 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 e9e903abe9 feat(base-formula): add tree-walking evaluator 2026-04-24 00:00:22 +01:00
Philipinho ded855e44e feat(base-formula): add dependency graph with topo and cycle detection 2026-04-23 23:55:55 +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 9ecf88511b page property 2026-04-20 21:27:29 +01:00
Philipinho 95d0457a7e refactor(base): drop /list suffix from base endpoints to match codebase convention 2026-04-18 23:36:52 +01:00
Philipinho d9e2d7ba3d chore(server): one-shot script to clean poisoned base view configs 2026-04-18 23:27:03 +01:00
Philipinho 44ec2dbe88 fix(base): stop jsonb char-key corruption in seed and guard view config spread 2026-04-18 23:26:03 +01:00