Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .changeset/6309-delete-object-fields-bridge.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
---
'@object-ui/app-shell': patch
'@object-ui/types': patch
'@object-ui/fields': patch
---

Delete the dead `metadata-admin/previews/object-fields-bridge.ts` module, and the three
prose references that still described it as wired.

The module exported `bridgeFromDraft`, `commitToDraft` and `FieldsBridgeResult` and had
**zero importers** — re-measured on the merged base, not inherited from the filing. Nothing
in the repository could reach it either: `@object-ui/app-shell`'s `exports` map declares
only `.` and `./styles.css`, so the file was not addressable as a deep import even from
outside the workspace.

Removing it is not the whole change. Three comments — in `types/src/designer.ts`, `types`'
`designer-field-types.test.ts` (twice) and `fields`' `richtext-cell-renderer-5452.test.tsx`
— cited the bridge as a live corroborating source. Left behind, they would have swapped
dead code for false documentation: three in-repo pointers telling a future reader that this
bridge mediates between the framework field record and `FieldDesigner`, and nothing telling
them it is unreachable. The two that named it as the consumer deriving an editable-subset
check from `DESIGNER_FIELD_TYPES` now name `MetadataFieldsPage`, which does exactly that
with the same idiom and the same `objectui#3017` anchor. The third cited the bridge's
`richtext` → `html` mapping as one of three corroborations that `richtext` stores HTML; the
other two (the showcase seed and the field-type decision tree) are live and carry the point
on their own, so that clause is dropped rather than repointed.

No behaviour changes: nothing imported the module, so there is nothing to migrate.

This file was deleted.

Original file line numberDiff line numberDiff line change
Expand Up@@ -9,15 +9,14 @@
/**
* objectui#5452: a POPULATED `richtext` field rendered as a completely empty
* cell. `richtext` stores HTML — that is what the showcase seed carries
* (`examples/app-showcase/src/data/seed/index.ts`, `f_richtext`), what
* (`examples/app-showcase/src/data/seed/index.ts`, `f_richtext`) and what
* `content/docs/data-modeling/field-type-decision-tree.mdx` documents
* ("Formatted content with HTML/WYSIWYG"), and what this repo's own designer
* bridge already assumes (`object-fields-bridge.ts` maps `richtext` to the
* designer's `html` type). The display registry nevertheless dispatched it to
* `MarkdownCellRenderer`, whose sanitizing GFM pipeline drops raw HTML — and
* since a richtext value is ENTIRELY HTML, everything was dropped and the cell
* came out blank. Failure direction is the bad one: no error, no fallback, no
* console warning, so a populated field reads as an empty field.
* ("Formatted content with HTML/WYSIWYG"). The display registry nevertheless
* dispatched it to `MarkdownCellRenderer`, whose sanitizing GFM pipeline drops
* raw HTML — and since a richtext value is ENTIRELY HTML, everything was
* dropped and the cell came out blank. Failure direction is the bad one: no
* error, no fallback, no console warning, so a populated field reads as an
* empty field.
*
* Two things are pinned here, and they pull in opposite directions on purpose:
*
Expand Down
9 changes: 4 additions & 5 deletions packages/types/src/__tests__/designer-field-types.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,8 +11,8 @@
*
* `DesignerFieldType` is derived from this array, `FieldDesigner`'s
* `FIELD_TYPE_META` must cover it (total `Record`, so tsc gates that side),
* and app-shell's `object-fields-bridge` builds its editable-subset check
* from it. The inventory below is a deliberate second statement of the list:
* and `MetadataFieldsPage` builds its editable-subset check from it. The
* inventory below is a deliberate second statement of the list:
* growing or shrinking the vocabulary is a two-file edit by design, so it
* cannot happen as a drive-by — the failure message routes the editor to the
* consumers that must be reviewed alongside it.
Expand All@@ -36,9 +36,8 @@ describe('DESIGNER_FIELD_TYPES (canonical Field Designer vocabulary)', () => {
it('matches the checked-in inventory — vocabulary edits must be deliberate', () => {
// If this fails you changed the designer's type vocabulary. That is fine,
// but it is never only a types change: FieldDesigner needs presentation
// (FIELD_TYPE_META + FIELD_TYPE_CATEGORIES), the object-fields-bridge
// round-trip should be re-checked for the new/removed type, and this
// inventory re-pinned to acknowledge the review happened.
// (FIELD_TYPE_META + FIELD_TYPE_CATEGORIES), and this inventory must be
// re-pinned to acknowledge the review happened.
expect([...DESIGNER_FIELD_TYPES].sort()).toEqual([...INVENTORY]);
});
});
6 changes: 3 additions & 3 deletions packages/types/src/designer.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -711,9 +711,9 @@ export interface ObjectManagerSchema extends BaseSchema {
* Single runtime source for every surface that enumerates the designer's
* vocabulary: `FieldDesigner` renders its palette in exactly this order (its
* `FIELD_TYPE_META` is a `Record<DesignerFieldType, …>`, so adding a member
* here without presentation is a compile error), and app-shell's
* `object-fields-bridge` derives its editable-subset check from it instead of
* restating the list (objectui#3017).
* here without presentation is a compile error), and `MetadataFieldsPage`
* derives its editable-subset check from it instead of restating the list
* (objectui#3017).
*/
export const DESIGNER_FIELD_TYPES = [
'text',
Expand Down
Loading