Skip to content

Add dedicated CRM listings support and detail adapters#408

Open
Connorbelez wants to merge 2 commits intoeng-276from
eng-280
Open

Add dedicated CRM listings support and detail adapters#408
Connorbelez wants to merge 2 commits intoeng-276from
eng-280

Conversation

@Connorbelez
Copy link
Copy Markdown
Owner

No description provided.

@linear
Copy link
Copy Markdown

linear Bot commented Apr 16, 2026

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 16, 2026

Warning

Rate limit exceeded

@Connorbelez has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 44 minutes and 5 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 44 minutes and 5 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ffe11146-dea2-497b-826c-2215757346cb

📥 Commits

Reviewing files that changed from the base of the PR and between 2b73878 and 32da638.

⛔ Files ignored due to path filters (1)
  • convex/_generated/api.d.ts is excluded by !**/_generated/**
📒 Files selected for processing (35)
  • convex/crm/__tests__/systemAdapters.test.ts
  • convex/crm/__tests__/viewEngine.test.ts
  • convex/crm/detailContextQueries.ts
  • convex/crm/entityAdapterRegistry.ts
  • convex/crm/entityViewFields.ts
  • convex/crm/entityViewHydration.ts
  • convex/crm/recordQueries.ts
  • convex/crm/relationCellPayloads.ts
  • convex/crm/systemAdapters/bootstrap.ts
  • convex/crm/systemAdapters/queryAdapter.ts
  • convex/crm/types.ts
  • convex/crm/viewQueries.ts
  • specs/ENG-280/chunks/chunk-01-native-listings-and-system-views/context.md
  • specs/ENG-280/chunks/chunk-01-native-listings-and-system-views/status.md
  • specs/ENG-280/chunks/chunk-01-native-listings-and-system-views/tasks.md
  • specs/ENG-280/chunks/chunk-02-dedicated-hydration-and-row-semantics/context.md
  • specs/ENG-280/chunks/chunk-02-dedicated-hydration-and-row-semantics/status.md
  • specs/ENG-280/chunks/chunk-02-dedicated-hydration-and-row-semantics/tasks.md
  • specs/ENG-280/chunks/chunk-03-dedicated-detail-rollout/context.md
  • specs/ENG-280/chunks/chunk-03-dedicated-detail-rollout/status.md
  • specs/ENG-280/chunks/chunk-03-dedicated-detail-rollout/tasks.md
  • specs/ENG-280/chunks/chunk-04-tests-and-validation/context.md
  • specs/ENG-280/chunks/chunk-04-tests-and-validation/status.md
  • specs/ENG-280/chunks/chunk-04-tests-and-validation/tasks.md
  • specs/ENG-280/chunks/manifest.md
  • specs/ENG-280/execution-checklist.md
  • specs/ENG-280/summary.md
  • specs/ENG-280/tasks.md
  • src/components/admin/shell/AdminEntityKanbanView.tsx
  • src/components/admin/shell/AdminEntityTableView.tsx
  • src/components/admin/shell/admin-view-rendering.tsx
  • src/components/admin/shell/dedicated-detail-panels.tsx
  • src/components/admin/shell/entity-view-adapters.tsx
  • src/lib/auth.ts
  • src/test/admin/admin-shell.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch eng-280

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

@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 16, 2026 16:14
Copy link
Copy Markdown
Owner Author

Connorbelez commented Apr 16, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

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

Copilot AI review requested due to automatic review settings April 16, 2026 16:14
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

Adds dedicated CRM support for marketplace listings and enriches admin list/detail UX for listings, mortgages, obligations, and borrowers by introducing entity-aware summaries, hydrated/computed fields, and dedicated detail renderers.

Changes:

  • Adds native listings table support to CRM system adapters + bootstrapped system object configs (fields, defaults, aggregates).
  • Introduces entity record materialization/hydration and wires it into table/kanban/view queries, record queries, and relation display payloads.
  • Adds dedicated detail panels (listings/mortgages/obligations) and upgrades admin row/card title + supporting text semantics to be entity-aware.

Reviewed changes

Copilot reviewed 35 out of 36 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/test/admin/admin-shell.test.ts Expands admin-shell tests for entity-aware title/supporting text and adapter semantics.
src/lib/auth.ts Import ordering cleanup (no behavior change).
src/components/admin/shell/entity-view-adapters.tsx Adds rollout dedicated detail adapter registry for select entities.
src/components/admin/shell/dedicated-detail-panels.tsx Introduces new dedicated detail panels backed by Convex queries.
src/components/admin/shell/admin-view-rendering.tsx Adds entity-specific summary formatting + updates supporting-text API.
src/components/admin/shell/AdminEntityTableView.tsx Passes adapter contract into supporting-text rendering.
src/components/admin/shell/AdminEntityKanbanView.tsx Passes adapter contract into supporting-text rendering.
convex/crm/viewQueries.ts Materializes/hydrates records before building rows + relation display values.
convex/crm/types.ts Extends computed field contract with materializationMode.
convex/crm/systemAdapters/queryAdapter.ts Adds native listings pagination/get-by-id support.
convex/crm/systemAdapters/bootstrap.ts Adds listings system object config + expands bootstrap to “repair” existing configs and seed defaults.
convex/crm/relationCellPayloads.ts Materializes referenced records to improve relation labels.
convex/crm/recordQueries.ts Materializes/hydrates query results and record detail surfaces.
convex/crm/entityViewHydration.ts New hydration layer to populate entity-specific summaries before computed fields apply.
convex/crm/entityViewFields.ts Adds new computed field evaluators and skips hydrated computed fields in sync evaluation.
convex/crm/entityAdapterRegistry.ts Expands dedicated adapter definitions (computed fields, overrides, layout/title candidates).
convex/crm/detailContextQueries.ts Adds admin-facing detail context queries for dedicated detail panels.
convex/crm/tests/viewEngine.test.ts Updates adapter schema expectations for new computed/visible fields.
convex/crm/tests/systemAdapters.test.ts Adds coverage for querying listings via CRM query path.
convex/_generated/api.d.ts Updates generated API typings for new Convex module(s).
specs/ENG-280/** Adds planning/checklist docs for the ENG-280 rollout.

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

Comment thread src/components/admin/shell/dedicated-detail-panels.tsx Outdated
Comment thread convex/crm/systemAdapters/bootstrap.ts Outdated
Comment thread convex/crm/entityViewHydration.ts Outdated
Comment thread convex/crm/entityViewHydration.ts
Comment thread convex/crm/viewQueries.ts
Comment thread convex/crm/systemAdapters/queryAdapter.ts
Copy link
Copy Markdown
Owner Author

@coderabbitai please review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 18, 2026

@Connorbelez Sure! I'll kick off a review of PR #408 now.


🧠 Learnings used
Learnt from: Connorbelez
Repo: Connorbelez/tanstackTemplate PR: 5
File: specs/governed-transitions/chunks/chunk-01-schema-machine/context.md:209-213
Timestamp: 2026-03-13T03:17:28.559Z
Learning: In the Connorbelez/tanstackTemplate repository, do not flag .md files for markdown formatting/linting issues (e.g., MD040 fenced code block language). Only reference .md files (specs, PRDs, design docs) when they reveal architectural drift or implementation inconsistencies against actual code.

Learnt from: Connorbelez
Repo: Connorbelez/tanstackTemplate PR: 115
File: convex/engine/effects/dealClosingPayments.ts:37-47
Timestamp: 2026-03-18T03:33:54.456Z
Learning: In Connorbelez/tanstackTemplate, `internalAction` handlers in Convex cannot atomically combine `ctx.runQuery` + `ctx.runMutation` — they are always separate transactions. The read-then-write idempotency pattern in effect handlers (e.g., `updatePaymentSchedule` in `convex/engine/effects/dealClosingPayments.ts`, `prorateAccrualBetweenOwners` in `convex/engine/effects/dealClosingProrate.ts`) is intentionally acceptable because the Transition Engine's OCC serializes concurrent transitions for the same entity upstream, preventing duplicate effect scheduling. Do NOT flag the split read-then-write pattern in `internalAction` effect handlers as a race condition requiring atomic fix — the upstream OCC is the primary guard. A defense-in-depth improvement (atomic `createIfNotExists` mutation) is tracked as a follow-up but is not a blocking issue.

Learnt from: Connorbelez
Repo: Connorbelez/tanstackTemplate PR: 105
File: convex/ledger/__tests__/concurrency.test.ts:0-0
Timestamp: 2026-03-17T11:00:19.343Z
Learning: In Connorbelez/tanstackTemplate, convex-test (used in convex/ledger/__tests__/) serializes all mutations sequentially. True OCC contention (e.g., two concurrent mints racing on the same mortgage) cannot be exercised in this harness — only the steady-state guards (e.g., ALREADY_MINTED) can be validated under serialized execution. Do NOT flag sequential-before-concurrent patterns in these test files as failing to test OCC; the file header comments document this limitation explicitly. True OCC retry behavior is guaranteed by Convex's production runtime and is out of scope for unit tests.

Learnt from: Connorbelez
Repo: Connorbelez/tanstackTemplate PR: 241
File: convex/crons.ts:30-34
Timestamp: 2026-03-21T20:15:34.305Z
Learning: In Connorbelez/tanstackTemplate, the `convex-dev-crons` component (referenced in CLAUDE.md) is reserved exclusively for *dynamic*, runtime-registered cron jobs — e.g., per-tenant or per-entity schedules that are created/destroyed at runtime. Fixed-interval infrastructure crons (e.g., daily reconciliation, daily obligation transitions, dispersal self-healing) all use static `cronJobs()` registration in `convex/crons.ts` and are deployed with the code. Do NOT flag static `crons.interval(...)` or `crons.daily(...)` registrations for fixed system-level jobs as needing `convex-dev-crons`.

Learnt from: CR
Repo: Connorbelez/tanstackTemplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-14T21:32:44.198Z
Learning: After completing major units of work, run `coderabbit review --plain` to get a code review summary and check for potential issues or improvements

Learnt from: CR
Repo: Connorbelez/tanstackTemplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-11T22:25:51.320Z
Learning: After completing a major unit of work, run `coderabbit review --plain` to get a code review summary and check for potential issues or improvements

Learnt from: CR
Repo: Connorbelez/tanstackTemplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-14T21:32:25.594Z
Learning: Run `coderabbit review --plain` after completing major units of work for code review summaries
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Connorbelez Connorbelez mentioned this pull request Apr 18, 2026
Copy link
Copy Markdown
Owner Author

@coderabbitai please re-review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 20, 2026

@Connorbelez Sure! I'll kick off a full re-review of PR #408 now.


🧠 Learnings used
Learnt from: Connorbelez
Repo: Connorbelez/tanstackTemplate PR: 115
File: convex/engine/effects/dealClosingPayments.ts:37-47
Timestamp: 2026-03-18T03:33:54.456Z
Learning: In Connorbelez/tanstackTemplate, `internalAction` handlers in Convex cannot atomically combine `ctx.runQuery` + `ctx.runMutation` — they are always separate transactions. The read-then-write idempotency pattern in effect handlers (e.g., `updatePaymentSchedule` in `convex/engine/effects/dealClosingPayments.ts`, `prorateAccrualBetweenOwners` in `convex/engine/effects/dealClosingProrate.ts`) is intentionally acceptable because the Transition Engine's OCC serializes concurrent transitions for the same entity upstream, preventing duplicate effect scheduling. Do NOT flag the split read-then-write pattern in `internalAction` effect handlers as a race condition requiring atomic fix — the upstream OCC is the primary guard. A defense-in-depth improvement (atomic `createIfNotExists` mutation) is tracked as a follow-up but is not a blocking issue.

Learnt from: Connorbelez
Repo: Connorbelez/tanstackTemplate PR: 115
File: convex/engine/effects/dealClosingProrate.ts:47-57
Timestamp: 2026-03-18T03:33:56.251Z
Learning: In Connorbelez/tanstackTemplate, the split idempotency pattern (ctx.runQuery to check existence, then ctx.runMutation to insert) used in Convex internalAction effect handlers (e.g., convex/engine/effects/dealClosingProrate.ts, convex/engine/effects/dealClosingPayments.ts) is intentional and correct. Convex actions cannot colocate a query and a mutation in a single transaction — runQuery and runMutation are always separate round-trips inside an action. The race condition is prevented at the scheduling level: the Transition Engine's OCC guarantees that only one effect dispatch can be in-flight for a given dealId at a time, so the pre-check window is never concurrent. Do NOT flag this split check-then-insert pattern in Convex action effect handlers as a race condition.

Learnt from: Connorbelez
Repo: Connorbelez/tanstackTemplate PR: 107
File: convex/engine/machines/deal.machine.ts:35-51
Timestamp: 2026-03-17T12:29:07.205Z
Learning: In Connorbelez/tanstackTemplate, the action stubs in `convex/engine/machines/deal.machine.ts` (reserveShares, notifyAllParties, createDocumentPackage, createDealAccess, archiveSignedDocuments, confirmFundsReceipt, commitReservation, prorateAccrualBetweenOwners, updatePaymentSchedule, voidReservation, notifyCancellation, revokeAllDealAccess) are intentional no-op stubs scoped to ENG-44 (machine definition + test matrix only). The actual effect handlers will be registered in `convex/engine/effects/registry.ts` in subsequent tickets. Do NOT flag these stubs as missing effect registrations — `scheduleEffects()` handles unregistered effects gracefully (warns and skips), so transitions persist correctly and there is no silent data loss. This is the intended incremental wiring pattern.

Learnt from: Connorbelez
Repo: Connorbelez/tanstackTemplate PR: 5
File: specs/governed-transitions/chunks/chunk-01-schema-machine/context.md:209-213
Timestamp: 2026-03-13T03:17:28.559Z
Learning: In the Connorbelez/tanstackTemplate repository, do not flag .md files for markdown formatting/linting issues (e.g., MD040 fenced code block language). Only reference .md files (specs, PRDs, design docs) when they reveal architectural drift or implementation inconsistencies against actual code.

Learnt from: Connorbelez
Repo: Connorbelez/tanstackTemplate PR: 393
File: convex/engine/commands.ts:146-159
Timestamp: 2026-04-14T17:59:52.345Z
Learning: In Connorbelez/tanstackTemplate, `confirmObligationPayment` in `convex/engine/commands.ts` is gated by `adminAction` (not `authedAction.use(requirePermissionAction(...))`) because it routes through `runManualInboundCollectionForObligation` with hardcoded `requestedByActorType: "admin"` and `triggerSource: "admin_manual"`. The explicit FairLend-admin boundary makes the audit provenance accurate. Do NOT suggest broadening this to a permission-gated authed action.

Learnt from: Connorbelez
Repo: Connorbelez/tanstackTemplate PR: 105
File: convex/ledger/__tests__/concurrency.test.ts:0-0
Timestamp: 2026-03-17T11:00:19.343Z
Learning: In Connorbelez/tanstackTemplate, convex-test (used in convex/ledger/__tests__/) serializes all mutations sequentially. True OCC contention (e.g., two concurrent mints racing on the same mortgage) cannot be exercised in this harness — only the steady-state guards (e.g., ALREADY_MINTED) can be validated under serialized execution. Do NOT flag sequential-before-concurrent patterns in these test files as failing to test OCC; the file header comments document this limitation explicitly. True OCC retry behavior is guaranteed by Convex's production runtime and is out of scope for unit tests.

Learnt from: CR
Repo: Connorbelez/tanstackTemplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-14T21:32:44.198Z
Learning: After completing major units of work, run `coderabbit review --plain` to get a code review summary and check for potential issues or improvements

Learnt from: Connorbelez
Repo: Connorbelez/tanstackTemplate PR: 5
File: specs/governed-transitions/design.md:158-159
Timestamp: 2026-03-13T03:23:52.156Z
Learning: In Connorbelez/tanstackTemplate, the `hasCompleteData` guard in `convex/demo/machines/loanApplication.machine.ts` is explicitly a POC/demo pattern: it reads from `context.data` (hydrated from the entity at creation time), NOT the event payload. The `SUBMIT` event carries no payload fields. In production, the guard may need to read from `event` instead (e.g., a SUBMIT event carrying latest form values). Both `specs/governed-transitions/design.md` and the machine file carry a TODO/POC note documenting this distinction.

Learnt from: Connorbelez
Repo: Connorbelez/tanstackTemplate PR: 297
File: convex/payments/transfers/__tests__/outboundFlow.integration.test.ts:0-0
Timestamp: 2026-03-28T02:22:53.467Z
Learning: In Connorbelez/tanstackTemplate, T-018 in `convex/payments/transfers/__tests__/outboundFlow.integration.test.ts` intentionally calls `publishTransferConfirmed._handler` directly (bypassing `confirmManualTransfer`). This is a deliberate effect-level test targeting the `postCashEntryInternal` idempotency guard. The public `confirmManualTransfer` path (provider/status guards, `providerRef` updates, and public-API rejection-when-already-confirmed behavior) is covered separately in `handlers.integration.test.ts`. Do NOT flag the direct `_handler` invocation in this test as bypassing guards — the test is explicitly scoped to the effect layer and its describe/it label says so.

Learnt from: CR
Repo: Connorbelez/tanstackTemplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-11T22:25:51.320Z
Learning: After completing a major unit of work, run `coderabbit review --plain` to get a code review summary and check for potential issues or improvements

Learnt from: CR
Repo: Connorbelez/tanstackTemplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-14T21:32:25.594Z
Learning: Run `coderabbit review --plain` after completing major units of work for code review summaries
✅ Actions performed

Full review triggered.

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