Skip to content

Feat/list scoped properties#61

Merged
th3-br41n merged 5 commits into
mainfrom
feat/list-scoped-properties
Jul 1, 2026
Merged

Feat/list scoped properties#61
th3-br41n merged 5 commits into
mainfrom
feat/list-scoped-properties

Conversation

@th3-br41n

Copy link
Copy Markdown
Contributor

No description provided.

th3-br41n and others added 5 commits June 30, 2026 18:44
…e/Files migration

The reorder/drag-handle grip "stuck to the content" in every list & table:
the hover-revealed six-dot grip was absolutely positioned over the first cell
with NO reserved gutter, so its 16px box overlapped the leading status glyph /
title. Root cause was the same class as DS-input — the grip element + its
spacing CSS were re-implemented per surface (.dbv-grid__drag-grip /
.content-row__drag-grip, identical copy-pasted blocks), so nothing owned "the
grip clears the content."

- .bs-drag-grip in @brainstorm/sdk/app-theme.css: the shared drag-handle face
  (box / text-faint glyph / grab cursor / hidden->revealed transition /
  absolute pin). Host supplies only the gutter offset (--bs-drag-grip-inset)
  and its one row-hover reveal selector.
- Database grid + Files content rows migrated onto the face, each reserving a
  real leading gutter so the grip parks clear of the first cell. The stage /
  list scroll containers clip overflow-x, so the gutter is reserved INSIDE the
  row (not floated into negative space — a negative offset just hid the grip's
  left half). Measured 4px grip->content gap on both, no clipping; head/body/
  foot share .dbv-grid__row so the grid columns stay aligned. Files group
  headings re-aligned to the indented row content.

typecheck (database+files) + database/files build + control-face/css-token/
biome ratchets clean. Verified by dogfood session 372.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…OQ-LD-2)

The "adding an object to a collection makes it inherit that collection's
properties" mechanism (book → Horror/Fantasy) was a documented contract
(Scope = { kind: "list", target }) with NO implementation: the property catalog
is a flat global key→PropertyDef map with no scope, and nothing resolves list
overlays onto members.

This lands the storage + resolution foundation:
- PropertyDef gains an optional scope field (backward-compatible; unscoped =
  today's global property). A def scoped { kind:"list", target: listId } is a
  collection overlay.
- New pure @brainstorm/sdk module list-scoped-properties: listsContainingEntity
  + inheritedPropertyDefs(entity, lists, catalog) → the overlay defs an entity
  inherits from its collections, over the shared effectiveMembers math. +8 tests.

OQ-LD-2 positions (documented in the module): manual membership for now
(query-list overlays resolved app-side); first-list-in-id-order wins on a key
collision; value HELD on leave (editing writes to the entity's own bag).

Next: authoring (add a property to a collection) + surfacing inherited props in
the inspector (database reference first), then roll to all apps.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The Database inspector's InspectorProperties now renders the entity's own
properties PLUS the collection-scoped overlays it inherits — resolved via
inheritedPropertyDefs(entity.id, state.lists, vault catalog). Inherited rows
are editable through the same shared cells; an own value for the same key wins
(entity > list precedence); editing writes to the entity's own bag (held on
leave). Reference implementation for the cross-app rollout.

typecheck + biome + database build clean; resolver logic covered by the 8
list-scoped-properties unit tests. End-to-end dogfood verify lands with the
authoring stage (creating a collection property), the next increment.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… property)

Completes the demoable loop: the column-adder gains '+ Add collection property…'
for collections you can manually add to (Manual/Hybrid lists). It opens the
shared inline property form and persists a PropertyDef scoped
{ kind: 'list', target: listId } — no view column; member entities pick it up
via inheritedPropertyDefs and render it editable in their inspectors.

So: add a property to Horror → add a book to Horror → the book's inspector shows
that property, editable, written to the book's own bag.

typecheck + biome + database build clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
# Conflicts:
#	apps/database/src/app.ts
#	apps/database/src/react/inspector-properties.tsx
@th3-br41n th3-br41n merged commit 7a17c56 into main Jul 1, 2026
3 checks passed
@th3-br41n th3-br41n deleted the feat/list-scoped-properties branch July 1, 2026 10:19
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