Skip to content

Improve Content table editing, layout, and recovery - #4433

Open
3mdistal wants to merge 2 commits into
mainfrom
codex/content-table-ergonomics
Open

Improve Content table editing, layout, and recovery#4433
3mdistal wants to merge 2 commits into
mainfrom
codex/content-table-ergonomics

Conversation

@3mdistal

@3mdistal 3mdistal commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Content tables could lose Text line breaks, mishandle invalid Number input, leave filtered rows stale after edits, and truncate wrapped values. Column presentation also coupled selection and freezing to Name, so moving columns left the controls in surprising places.

Every data column now has a compact menu with per-column wrapping and explicit freezing. Row selection stays in a leading gutter, independent of column order. Freeze follows the displayed prefix through the chosen column; a responsive cap leaves room to scroll. The selection toolbar grows on narrow screens so the count and actions remain readable.

Saved views preserve column order, widths, wrap overrides and freeze endpoints. Older clients preserve omitted fields, hidden endpoints retain their settings, and deleting an endpoint clears it. Serialized saves restore the latest committed arrangement on failure and show an error, including when an earlier queued save succeeds first. Typed actions and screen state expose the same presentation settings to agents.

The earlier editing and recovery repairs remain included: typed values and line breaks survive editing, bounded queries refresh after writes, title-first creation preserves the same page, initial document-read failures offer Retry, and already-open editors stay mounted through background reads.

Validation: focused state, action, grid, menu and save-recovery tests; Content product-impact tests; Content typecheck/build; all 69 repository guards including localization; and independent technical review passed. The final mobile toolbar repair also passed 120 existing table tests and a focused independent mobile/desktop recheck. Browser QA exercised wrapping, pointer/keyboard ordering, loaded-row selection, freezing, resizing, hide/restore/delete, view isolation/duplication, menus, empty tables and delayed/failed saves at desktop and mobile sizes. The queued failure test verified rollback to the first successful commit.

The final live resubmission check passed: the same mounted tab saved arrangement A, received B from another tab, and submitted A again with one UI change. A persistent receiver observed all three states live; the first and final saved configurations were exactly equal and survived reload. A third observing peer was used during browser verification. Both disposable QA pages are in recoverable Trash and the existing user playground is preserved. Six tester-owned tabs were navigated to about:blank because the browser harness has no close operation; the fault proxy is stopped. Motion cadence is unverified from sampled screenshots. CI build, typecheck, all five targeted test lanes, Content database/parity, PostgreSQL/PGlite locking, security and trusted-acceptance checks passed on this update. Standalone Chat E2E and automated review are still running; no check failures are reported.

Before any future merge, verify column-presentation persistence and mutation refresh on the merged candidate's PGlite runtime, and confirm two tabs each receive their own screen state. Local acceptance does not establish the cause of the historical hosted loading hang or beta/production health. This PR remains unmerged.

content_product_impact:
  lane: contract_fulfillment
  features:
    - content.feature.see-your-information-your-way
  capabilities:
    - content.renderer.typed
    - content.view.query
    - content.view.renderer-conformance
    - content.view.scale
  record_change: none
  proof:
    - Focused Content tests and build
    - Independent technical review
    - Independent desktop and mobile browser checks, including live cross-tab resubmission
  rationale: Repairs typed editing and query reconciliation and fulfills flexible table column presentation without changing data ownership or access.

@netlify

This comment has been minimized.

@3mdistal
3mdistal marked this pull request as ready for review September 6, 2026 17:31
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Here's a visual recap of what changed:

Visual recap

Open the full interactive recap

@builder-io-integration builder-io-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builder reviewed your changes and found 3 potential issues 🟡

Review Details

Code Review Summary

PR #4433 substantially improves Content table ergonomics: typed scalar editors now preserve multiline text and recover from invalid numeric input, bounded database queries are reconciled after mutations, and column order—including Name—is persisted across headers, rows, and footers. The changes are covered by extensive focused tests and the overall architecture is sound, with shared action/query surfaces and serialized writes rather than duplicate APIs. This is a standard-risk change because it modifies shared UI state, mutation reconciliation, and document/database editing behavior.

Key Findings

  • 🟡 MEDIUM: Name is still unconditionally sticky left-0, so moving it away from the first column can break visual alignment and obscure preceding columns.
  • 🟡 MEDIUM: Title updates invalidate only cached pages already containing the document, so a filtered query can remain stale when an excluded row becomes newly eligible.
  • 🟡 MEDIUM: Per-call view-save success handling can apply an older response after a newer save and temporarily restore stale layout state.
  • 🟡 LOW: The Name drag preview uses a hard-coded English label instead of the localized label.

The browser test planner designed 18 affected-flow cases, but execution was blocked: all browser executors lacked the required Chrome automation tools while the dev server was healthy. 🧪 Browser testing: Skipped — browser automation infrastructure unavailable; rerun after tooling is restored.

Comment thread templates/content/app/components/editor/database/DatabaseTableGrid.tsx Outdated
void queryClient.invalidateQueries({
queryKey: ["action", "list-documents"],
});
void queryClient.invalidateQueries(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Title edits do not refresh filtered database pages that omit the row

This invalidates only contentDatabaseItemsContainingDocumentFilter(variables.id), which targets cached pages where the document is already present. If a search/filter currently excludes the document, changing its title can make it newly match without invalidating that query, so the row remains absent until an unrelated refetch. Refresh active constrained database queries for title/search membership changes as well.

Additional Info
Found by 1 of 4 code-review agents; independently verified against the changed mutation path.

Fix in Builder

Comment thread templates/content/app/components/editor/database/DatabaseView.tsx

@builder-io-integration builder-io-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builder reviewed your changes — no new findings

Review Details

Incremental Code Review Summary

The latest PR revision expands the table presentation model: selection is now a leading gutter independent of column order, each data column supports wrapping and explicit freezing, freezing follows the displayed prefix with a responsive cap, and saved views persist order, widths, wrapping, and freeze endpoints with backward-compatible migration and rollback. The earlier save-response race and Name-sticky layout issue are fixed and their review threads were resolved. The previously reported filtered-query invalidation issue remains open and was not reposted.

Three independent review agents inspected the complete 5,517-line shuffled diff with balanced aggressiveness and found no new confirmed bugs. Focused state, action, grid, menu, and save-recovery tests passed; one agent encountered template alias resolution failures in UI-oriented test suites, but this did not establish a PR regression.

Risk remains standard because the change affects shared UI state, persisted view configuration, synchronization, and database editing. 🧪 Browser testing: Skipped — the Content dev server's database pool fails authentication with Cannot use a pool after calling end on the pool; all 15 planned cases were couldnt_verify/env_issue, so browser verification should be rerun after the server infrastructure is repaired.

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.

2 participants