Skip to content

fix(app): prevent url param collision between fields sheet and table filter - #175

Merged
carhartlewis merged 2 commits into
mainfrom
lewis/field-fix
Aug 21, 2026
Merged

fix(app): prevent url param collision between fields sheet and table filter#175
carhartlewis merged 2 commits into
mainfrom
lewis/field-fix

Conversation

@github-actions

@github-actions github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Opened automatically when lewis/field-fix was pushed.

The title is written from the diff and rewritten as you push, because this is squashed onto main and the title becomes the commit subject and the changelog line. Retitle it yourself and it is yours — the automation stops touching it.


Summary by cubic

Prevents URL search-param collisions between the fields sheet and list filters, and makes the test database rebuild itself when it drifts. Previously both used the fields key and db:test left stale state; now the fields sheet uses manageFields/manageField and db:test drops and recreates crm_test if it holds foreign migrations or schema drift.

  • Centralizes URL keys in SEARCH_PARAM with a reserved key set and assertUnreservedSearchParamKeys to prevent collisions; replaces hard-coded keys across creation sheets, record stack, timeline, quick switcher, and overview. List tables now build parsers from SEARCH_PARAM and validate facet/tab ids. Adds tests to enforce unique ownership of keys and updates docs.
  • db:test now detects drift (foreign migrations or schema mismatch via prisma migrate diff) and rebuilds crm_test; --reset forces a rebuild. It refuses non-_test names and reports a missing prisma binary. Docs updated.

Migration

  • Update any deep links or automations that opened the fields sheet to use manageFields and manageField.
  • When adding list facets or tab ids, avoid reserved keys and call assertUnreservedSearchParamKeys in createListSearchParams.
  • Local dev: running db:test may drop and recreate crm_test when drift is detected; use --reset to force a rebuild. Ensure prisma is available via the package script.

Written for commit 572724a. Summary will update on new commits.

Review in cubic

Updated various components to utilize the new SEARCH_PARAM constants for managing query states, enhancing consistency and maintainability across the application. This includes changes in dashboard-summary, overview-greeting, overview-scope, and several forms related to company, contact, and deal creation. Additionally, introduced tests for the SEARCH_PARAM structure to ensure no key collisions occur.
@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
crm-agent Ready Ready Preview Aug 21, 2026 2:12pm
crm-api Ready Ready Preview Aug 21, 2026 2:12pm
crm-app Ready Ready Preview Aug 21, 2026 2:12pm

Request Review

migrate deploy only adds what is missing, so a crm_test built on an
abandoned branch kept that branch's tables and constraints forever. A
stray trackedEvent_visitorId_fkey failed seven tracking specs on every
branch. db:test now rebuilds the database when it holds a migration this
branch does not have, or no longer matches schema.prisma, and --reset
forces it. A missing prisma binary now reports itself instead of exiting
silently.

@cubic-dev-ai cubic-dev-ai 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.

1 issue found and verified against the latest diff

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="docs/plan/dynamic-fields-build.md">

<violation number="1" location="docs/plan/dynamic-fields-build.md:44">
P2: The rename to `manageFields`/`manageField` was applied only to the §1 artboard table; §6 (URL state, lines 175-176, 179, 189) still tells the implementer to add `fields`/`field` params, the very names this PR renames to avoid collision. The build doc now contradicts itself on the parameter names it is meant to standardize. Update §6 to use `manageFields`/`manageField` consistently.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

| `…&fields=company&field=new` | Create a field |
| `…&fields=company&field=runs_on` | Edit a field, with coverage |
| `…&fields=company&field=runs_on (archive)` | Archive confirmation |
| `…&manageFields=company` | The fields sheet — list state |

@cubic-dev-ai cubic-dev-ai Bot Aug 21, 2026

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.

P2: The rename to manageFields/manageField was applied only to the §1 artboard table; §6 (URL state, lines 175-176, 179, 189) still tells the implementer to add fields/field params, the very names this PR renames to avoid collision. The build doc now contradicts itself on the parameter names it is meant to standardize. Update §6 to use manageFields/manageField consistently.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/plan/dynamic-fields-build.md, line 44:

<comment>The rename to `manageFields`/`manageField` was applied only to the §1 artboard table; §6 (URL state, lines 175-176, 179, 189) still tells the implementer to add `fields`/`field` params, the very names this PR renames to avoid collision. The build doc now contradicts itself on the parameter names it is meant to standardize. Update §6 to use `manageFields`/`manageField` consistently.</comment>

<file context>
@@ -41,11 +41,11 @@ Paper file **CRM**, page **crm - lewis**:
-| `…&fields=company&field=new` | Create a field |
-| `…&fields=company&field=runs_on` | Edit a field, with coverage |
-| `…&fields=company&field=runs_on (archive)` | Archive confirmation |
+| `…&manageFields=company` | The fields sheet — list state |
+| `…&manageFields=company (first run)` | Empty state |
+| `…&manageFields=company&manageField=new` | Create a field |
</file context>
Fix with cubic

@carhartlewis
carhartlewis merged commit 1cebe1e into main Aug 21, 2026
9 checks passed
@carhartlewis
carhartlewis deleted the lewis/field-fix branch August 21, 2026 14:15
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