Skip to content

eng-277#396

Merged
Connorbelez merged 5 commits intomainfrom
eng277
Apr 14, 2026
Merged

eng-277#396
Connorbelez merged 5 commits intomainfrom
eng277

Conversation

@Connorbelez
Copy link
Copy Markdown
Owner

@Connorbelez Connorbelez commented Apr 13, 2026

Summary by CodeRabbit

  • New Features

    • Added read-only kanban board layout for admin entity views with single-select field grouping.
    • Introduced shared admin view interface enabling table and kanban mode switching with persistent layout selection.
    • Added toolbar controls for viewing mode and board field selection.
  • Bug Fixes

    • Restricted kanban layout eligibility to single-select fields only.
  • Documentation

    • Added project specifications and implementation tracking for kanban view engine integration.

@linear
Copy link
Copy Markdown

linear bot commented Apr 13, 2026

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 13, 2026

Caution

Review failed

An error occurred during the review process. Please try again later.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch eng277

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Owner Author

Connorbelez commented Apr 13, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Connorbelez Connorbelez mentioned this pull request Apr 13, 2026
Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Sorry @Connorbelez, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@Connorbelez Connorbelez marked this pull request as ready for review April 14, 2026 14:41
Copilot AI review requested due to automatic review settings April 14, 2026 14:41
Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Implements ENG-277’s production admin “view engine” surface (table + read-only kanban) and migrates admin routes and Convex test helpers to align with the new CRM-backed view contracts.

Changes:

  • Added shared admin view-engine context resolution + shared AdminEntityViewPage that renders table/kanban from CRM view state and persists layout via saved views / viewDefs.
  • Migrated admin entity routes (dedicated + /admin/$entitytype) from scaffolded/fake tables to the shared view-engine surface.
  • Moved Convex test helper modules out of convex/**/__tests__ helper paths into src/test/convex/** to reduce Convex codegen/module-analysis surface area.

Reviewed changes

Copilot reviewed 83 out of 84 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/test/convex/registerAuditLogComponent.ts New test helper wrapper for registering the audit log component outside convex/test.
src/test/convex/payments/cashLedger/testUtils.ts Centralized cash-ledger Convex test harness/utils in src/test for reuse by many convex/** tests.
src/test/convex/payments/cashLedger/e2eHelpers.ts Updated cash-ledger e2e helper imports to match moved test utilities.
src/test/convex/listings/create.test.ts Updated audit log component registration import path.
src/test/convex/crm/helpers.ts Updated CRM Convex test harness helper imports/paths after relocating helpers.
src/test/admin/admin-view-context.test.ts Added unit tests for admin view-context resolution logic.
src/test/admin/admin-shell.test.ts Refactored test fixture helpers (removed duplicates / formatting changes).
src/routes/admin/properties/route.tsx Migrated properties list route to AdminEntityViewPage.
src/routes/admin/obligations/route.tsx Migrated obligations list route to AdminEntityViewPage (removed fake data).
src/routes/admin/mortgages/route.tsx Migrated mortgages list route to AdminEntityViewPage.
src/routes/admin/listings/route.tsx Migrated listings list route to AdminEntityViewPage.
src/routes/admin/deals/route.tsx Migrated deals route to AdminEntityViewPage (replacing prior dedicated kanban board).
src/routes/admin/borrowers/route.tsx Migrated borrowers list route to AdminEntityViewPage (removed fake data).
src/routes/admin/$entitytype.tsx Migrated dynamic entity route to AdminEntityViewPage and removed legacy react-query loader.
src/lib/admin-view-context.ts New canonical resolver for entityType → objectDef/views/savedViews + active view selection.
src/lib/admin-entity-queries.ts Narrowed legacy listEntityRows query helper typing (now explicitly “legacy” scoped).
src/lib/admin-entities.ts Expanded the canonical admin entity type set + labels.
src/components/demo/crm/RecordTableSurface.tsx Tightened demo kanban field selection to single-select only (aligning with new kanban contract).
src/components/admin/shell/admin-view-types.ts Added shared admin view-engine result/column/group types for table + kanban surfaces.
src/components/admin/shell/admin-view-rendering.tsx Added shared field rendering + kanban option derivation helpers for admin view engine UI.
src/components/admin/shell/AdminEntityViewToolbar.tsx Added reusable toolbar supporting table/kanban toggles + board-field selector.
src/components/admin/shell/AdminEntityViewToolbar.stories.tsx Added Storybook coverage for the new toolbar component.
src/components/admin/shell/AdminEntityViewPage.tsx Added shared orchestration page: loads context + schema, queries records, persists layout selection, renders table/kanban.
src/components/admin/shell/AdminEntityTableView.tsx Added admin table renderer for view-engine record results.
src/components/admin/shell/AdminEntityKanbanView.tsx Added read-only admin kanban renderer for grouped view-engine results.
specs/ENG-277/tasks.md Added ENG-277 task tracking document.
specs/ENG-277/summary.md Added ENG-277 implementation summary + scope/constraints.
specs/ENG-277/execution-checklist.md Added execution checklist + validation state for ENG-277.
specs/ENG-277/chunks/manifest.md Added chunk manifest for ENG-277 work breakdown.
specs/ENG-277/chunks/chunk-03-route-rollout/tasks.md Added per-chunk task list (route rollout).
specs/ENG-277/chunks/chunk-03-route-rollout/status.md Added per-chunk status (route rollout).
specs/ENG-277/chunks/chunk-03-route-rollout/context.md Added per-chunk context (route rollout).
specs/ENG-277/chunks/chunk-02-kanban-surface/tasks.md Added per-chunk task list (kanban surface).
specs/ENG-277/chunks/chunk-02-kanban-surface/status.md Added per-chunk status (kanban surface).
specs/ENG-277/chunks/chunk-02-kanban-surface/context.md Added per-chunk context (kanban surface).
specs/ENG-277/chunks/chunk-01-view-context/tasks.md Added per-chunk task list (view context).
specs/ENG-277/chunks/chunk-01-view-context/status.md Added per-chunk status (view context).
specs/ENG-277/chunks/chunk-01-view-context/context.md Added per-chunk context (view context).
e2e/demo-listings.spec.ts Strengthened demo listing fixture assertion (fails fast if fixture missing).
convex/test/registerAuditLogComponent.ts Deleted old Convex-side test helper (replaced by src/test/convex/registerAuditLogComponent.ts).
convex/payments/cashLedger/tests/writeOff.test.ts Updated to import moved cash-ledger test utils from src/test/convex.
convex/payments/cashLedger/tests/waiver.test.ts Updated to import moved cash-ledger test utils from src/test/convex.
convex/payments/cashLedger/tests/transferReconciliation.test.ts Updated to import moved cash-ledger test utils from src/test/convex.
convex/payments/cashLedger/tests/suspenseResolution.test.ts Updated to import moved cash-ledger test utils from src/test/convex.
convex/payments/cashLedger/tests/servicingFeeRecognition.test.ts Updated to import moved cash-ledger test utils from src/test/convex.
convex/payments/cashLedger/tests/sequenceCounter.test.ts Updated audit log registration import to use src/test/convex helper.
convex/payments/cashLedger/tests/reversalReconciliation.test.ts Updated to import moved cash-ledger test utils from src/test/convex.
convex/payments/cashLedger/tests/reversalIntegration.test.ts Updated to import moved cash-ledger test utils from src/test/convex.
convex/payments/cashLedger/tests/reversalCascade.test.ts Updated to import moved cash-ledger test utils from src/test/convex.
convex/payments/cashLedger/tests/replayIntegrity.test.ts Updated to import moved cash-ledger test utils from src/test/convex.
convex/payments/cashLedger/tests/reconciliationSuite.test.ts Updated to import moved cash-ledger test utils from src/test/convex.
convex/payments/cashLedger/tests/postingGroups.test.ts Updated to import moved cash-ledger test utils from src/test/convex.
convex/payments/cashLedger/tests/postingGroupIntegration.test.ts Updated to import moved cash-ledger test utils from src/test/convex.
convex/payments/cashLedger/tests/postEntry.test.ts Updated to import moved cash-ledger test utils from src/test/convex.
convex/payments/cashLedger/tests/paymentReversalIntegration.test.ts Updated to import moved cash-ledger test utils from src/test/convex.
convex/payments/cashLedger/tests/lenderPayoutPosting.test.ts Updated to import moved cash-ledger test utils from src/test/convex.
convex/payments/cashLedger/tests/lenderPayableIntegration.test.ts Updated to import moved cash-ledger test utils from src/test/convex.
convex/payments/cashLedger/tests/lenderPayableBalance.test.ts Updated to import moved cash-ledger test utils from src/test/convex.
convex/payments/cashLedger/tests/integration.test.ts Updated to import moved cash-ledger test utils from src/test/convex.
convex/payments/cashLedger/tests/financialInvariants.test.ts Updated to import moved cash-ledger test utils from src/test/convex.
convex/payments/cashLedger/tests/financialInvariantStress.test.ts Updated to import moved cash-ledger test utils from src/test/convex.
convex/payments/cashLedger/tests/entryTypes.test.ts Updated to import moved cash-ledger test utils from src/test/convex.
convex/payments/cashLedger/tests/e2eLifecycle.test.ts Updated to import moved cash-ledger e2e helpers + test utils from src/test/convex.
convex/payments/cashLedger/tests/disbursementGate.test.ts Updated to import moved cash-ledger test utils from src/test/convex.
convex/payments/cashLedger/tests/dealCashEvents.test.ts Updated to import moved cash-ledger test utils from src/test/convex.
convex/payments/cashLedger/tests/corrections.test.ts Updated to import moved cash-ledger test utils from src/test/convex.
convex/payments/cashLedger/tests/constraintsAndBalanceExemption.test.ts Updated to import moved cash-ledger test utils from src/test/convex.
convex/payments/cashLedger/tests/chaosTests.test.ts Updated to import moved cash-ledger e2e helpers + test utils from src/test/convex.
convex/payments/cashLedger/tests/cashReceiptIntegration.test.ts Updated to import moved cash-ledger test utils from src/test/convex.
convex/payments/cashLedger/tests/cashReceipt.test.ts Updated to import moved cash-ledger test utils from src/test/convex.
convex/payments/cashLedger/tests/cashApplication.test.ts Updated to import moved cash-ledger test utils from src/test/convex.
convex/payments/cashLedger/tests/auditTrail.test.ts Updated to import moved cash-ledger constants from src/test/convex.
convex/ledger/tests/testUtils.test.ts Updated audit log registration import to use new src/test/convex helper.
convex/crm/viewState.ts Updated kanban disabled-layout message to “single-select” wording.
convex/crm/viewQueries.ts Updated kanban query doc comment (removed multi-select grouping narrative).
convex/crm/viewDefs.ts Updated kanban validation error message to “single-select” wording.
convex/crm/metadataCompiler.ts Enforced kanban eligibility strictly for select (single-select) fields.
convex/crm/tests/walkthrough.test.ts Updated test harness imports to new src/test/convex/crm/helpers.
convex/crm/tests/viewEngine.test.ts Updated harness imports and expected kanban messaging to “single-select”.
convex/crm/tests/userSavedViews.test.ts Updated harness imports to new src/test/convex/crm/helpers.
convex/crm/tests/systemAdapters.test.ts Updated harness imports to new src/test/convex/crm/helpers.
convex/crm/tests/records.test.ts Updated harness imports to new src/test/convex/crm/helpers.
convex/crm/tests/metadataCompiler.test.ts Updated harness imports + adjusted expectations for multi_select capability.
convex/_generated/api.d.ts Codegen output updated to drop references to removed/moved convex/**/__tests__ helper modules.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/lib/admin-view-context.ts Outdated
Comment thread src/test/admin/admin-view-context.test.ts
Comment thread src/components/admin/shell/admin-view-rendering.tsx
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/admin/shell/admin-view-rendering.tsx`:
- Around line 169-175: The "boolean" case currently treats any non-true value as
False and can misrepresent bad data; update the "boolean" switch branch to first
check typeof value === "boolean" and only render the Badge/CheckCheck and
"True"/"False" when that strict type check passes, otherwise render a neutral
placeholder (e.g., an empty span or "—") to indicate invalid/non-boolean data;
target the "boolean" case in admin-view-rendering.tsx and the Badge/CheckCheck
rendering logic to add the typeof guard.

In `@src/components/admin/shell/AdminEntityTableView.tsx`:
- Around line 65-71: The TableRow currently only supports mouse clicks for
selection; when onSelectRecord is provided make the row focusable and
keyboard-activatable by adding tabIndex={0}, a semantic role (e.g.,
role="button"), and an onKeyDown handler that calls onSelectRecord(record._id)
on Enter or Space key presses; update the TableRow JSX where onSelectRecord is
used (the TableRow element that references record._id and onClick) to include
these attributes and ensure the cursor/hover styling remains conditional on
onSelectRecord.

In `@src/components/admin/shell/AdminEntityViewPage.tsx`:
- Around line 371-381: handleNextTablePage currently reads tablePageIndex from
render scope causing stale-state races on rapid clicks; change both updates to
use functional updaters so they use the same previous state. Specifically,
inside handleNextTablePage keep the early return on !tableResult?.cursor, then
call setTablePageIndex(prevIndex => { const nextIndex = prevIndex + 1;
setTableCursorHistory(prevHistory => prevHistory[nextIndex] ===
tableResult.cursor ? prevHistory : [...prevHistory, tableResult.cursor]); return
nextIndex; }); so setTablePageIndex and setTableCursorHistory both derive from
the same prevIndex/prevHistory and avoid index drift (references:
handleNextTablePage, tableResult.cursor, setTableCursorHistory, tablePageIndex,
setTablePageIndex).

In `@src/lib/admin-view-context.ts`:
- Around line 94-98: The current viewMode computation can mismatch because it
checks activeSavedView independently from activeSourceView; change it to derive
viewMode from the resolved source view (e.g., compute a single resolvedSource =
activeSourceView ?? activeSavedView or similar) and then set viewMode =
resolvedSource?.viewType === "kanban" ? "kanban" : "table" so the mode always
follows the actual source view (referencing activeSourceView, activeSavedView,
and viewMode to locate the logic).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6204693d-30f5-42f4-bc3e-9101de26c47d

📥 Commits

Reviewing files that changed from the base of the PR and between 3a5ca5e and f3b897c.

⛔ Files ignored due to path filters (1)
  • convex/_generated/api.d.ts is excluded by !**/_generated/**
📒 Files selected for processing (83)
  • convex/crm/__tests__/metadataCompiler.test.ts
  • convex/crm/__tests__/records.test.ts
  • convex/crm/__tests__/systemAdapters.test.ts
  • convex/crm/__tests__/userSavedViews.test.ts
  • convex/crm/__tests__/viewEngine.test.ts
  • convex/crm/__tests__/walkthrough.test.ts
  • convex/crm/metadataCompiler.ts
  • convex/crm/viewDefs.ts
  • convex/crm/viewQueries.ts
  • convex/crm/viewState.ts
  • convex/ledger/__tests__/testUtils.test.ts
  • convex/payments/cashLedger/__tests__/auditTrail.test.ts
  • convex/payments/cashLedger/__tests__/cashApplication.test.ts
  • convex/payments/cashLedger/__tests__/cashReceipt.test.ts
  • convex/payments/cashLedger/__tests__/cashReceiptIntegration.test.ts
  • convex/payments/cashLedger/__tests__/chaosTests.test.ts
  • convex/payments/cashLedger/__tests__/constraintsAndBalanceExemption.test.ts
  • convex/payments/cashLedger/__tests__/corrections.test.ts
  • convex/payments/cashLedger/__tests__/dealCashEvents.test.ts
  • convex/payments/cashLedger/__tests__/disbursementGate.test.ts
  • convex/payments/cashLedger/__tests__/e2eLifecycle.test.ts
  • convex/payments/cashLedger/__tests__/entryTypes.test.ts
  • convex/payments/cashLedger/__tests__/financialInvariantStress.test.ts
  • convex/payments/cashLedger/__tests__/financialInvariants.test.ts
  • convex/payments/cashLedger/__tests__/integration.test.ts
  • convex/payments/cashLedger/__tests__/lenderPayableBalance.test.ts
  • convex/payments/cashLedger/__tests__/lenderPayableIntegration.test.ts
  • convex/payments/cashLedger/__tests__/lenderPayoutPosting.test.ts
  • convex/payments/cashLedger/__tests__/paymentReversalIntegration.test.ts
  • convex/payments/cashLedger/__tests__/postEntry.test.ts
  • convex/payments/cashLedger/__tests__/postingGroupIntegration.test.ts
  • convex/payments/cashLedger/__tests__/postingGroups.test.ts
  • convex/payments/cashLedger/__tests__/reconciliationSuite.test.ts
  • convex/payments/cashLedger/__tests__/replayIntegrity.test.ts
  • convex/payments/cashLedger/__tests__/reversalCascade.test.ts
  • convex/payments/cashLedger/__tests__/reversalIntegration.test.ts
  • convex/payments/cashLedger/__tests__/reversalReconciliation.test.ts
  • convex/payments/cashLedger/__tests__/sequenceCounter.test.ts
  • convex/payments/cashLedger/__tests__/servicingFeeRecognition.test.ts
  • convex/payments/cashLedger/__tests__/suspenseResolution.test.ts
  • convex/payments/cashLedger/__tests__/transferReconciliation.test.ts
  • convex/payments/cashLedger/__tests__/waiver.test.ts
  • convex/payments/cashLedger/__tests__/writeOff.test.ts
  • convex/test/registerAuditLogComponent.ts
  • e2e/demo-listings.spec.ts
  • specs/ENG-277/chunks/chunk-01-view-context/context.md
  • specs/ENG-277/chunks/chunk-01-view-context/status.md
  • specs/ENG-277/chunks/chunk-01-view-context/tasks.md
  • specs/ENG-277/chunks/chunk-02-kanban-surface/context.md
  • specs/ENG-277/chunks/chunk-02-kanban-surface/status.md
  • specs/ENG-277/chunks/chunk-02-kanban-surface/tasks.md
  • specs/ENG-277/chunks/chunk-03-route-rollout/context.md
  • specs/ENG-277/chunks/chunk-03-route-rollout/status.md
  • specs/ENG-277/chunks/chunk-03-route-rollout/tasks.md
  • specs/ENG-277/chunks/manifest.md
  • specs/ENG-277/execution-checklist.md
  • specs/ENG-277/summary.md
  • specs/ENG-277/tasks.md
  • src/components/admin/shell/AdminEntityKanbanView.tsx
  • src/components/admin/shell/AdminEntityTableView.tsx
  • src/components/admin/shell/AdminEntityViewPage.tsx
  • src/components/admin/shell/AdminEntityViewToolbar.stories.tsx
  • src/components/admin/shell/AdminEntityViewToolbar.tsx
  • src/components/admin/shell/admin-view-rendering.tsx
  • src/components/admin/shell/admin-view-types.ts
  • src/components/demo/crm/RecordTableSurface.tsx
  • src/lib/admin-entities.ts
  • src/lib/admin-entity-queries.ts
  • src/lib/admin-view-context.ts
  • src/routes/admin/$entitytype.tsx
  • src/routes/admin/borrowers/route.tsx
  • src/routes/admin/deals/route.tsx
  • src/routes/admin/listings/route.tsx
  • src/routes/admin/mortgages/route.tsx
  • src/routes/admin/obligations/route.tsx
  • src/routes/admin/properties/route.tsx
  • src/test/admin/admin-shell.test.ts
  • src/test/admin/admin-view-context.test.ts
  • src/test/convex/crm/helpers.ts
  • src/test/convex/listings/create.test.ts
  • src/test/convex/payments/cashLedger/e2eHelpers.ts
  • src/test/convex/payments/cashLedger/testUtils.ts
  • src/test/convex/registerAuditLogComponent.ts
💤 Files with no reviewable changes (1)
  • convex/test/registerAuditLogComponent.ts

Comment thread src/components/admin/shell/admin-view-rendering.tsx
Comment thread src/components/admin/shell/AdminEntityTableView.tsx
Comment thread src/components/admin/shell/AdminEntityViewPage.tsx Outdated
Comment thread src/lib/admin-view-context.ts Outdated
@Connorbelez Connorbelez marked this pull request as draft April 14, 2026 17:26
@Connorbelez Connorbelez changed the base branch from test-fixes to graphite-base/396 April 14, 2026 17:30
@Connorbelez Connorbelez marked this pull request as ready for review April 14, 2026 21:23
Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Sorry @Connorbelez, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@Connorbelez Connorbelez changed the base branch from graphite-base/396 to test-fixes April 14, 2026 21:23
@Connorbelez Connorbelez changed the base branch from test-fixes to graphite-base/396 April 14, 2026 21:26
@graphite-app graphite-app bot changed the base branch from graphite-base/396 to main April 14, 2026 21:27
@graphite-app
Copy link
Copy Markdown

graphite-app bot commented Apr 14, 2026

Merge activity

  • Apr 14, 9:28 PM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.
  • Apr 14, 9:29 PM UTC: @Connorbelez merged this pull request with Graphite.

@Connorbelez Connorbelez merged commit 4ea5880 into main Apr 14, 2026
0 of 2 checks passed
Connorbelez added a commit that referenced this pull request Apr 20, 2026
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **New Features**
  * Added read-only kanban board layout for admin entity views with single-select field grouping.
  * Introduced shared admin view interface enabling table and kanban mode switching with persistent layout selection.
  * Added toolbar controls for viewing mode and board field selection.

* **Bug Fixes**
  * Restricted kanban layout eligibility to single-select fields only.

* **Documentation**
  * Added project specifications and implementation tracking for kanban view engine integration.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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