Skip to content

improvement(url-state): migrate list search/sort/filter view-state to nuqs#5648

Merged
waleedlatif1 merged 4 commits into
stagingfrom
nuqs-url-state-fixes
Jul 14, 2026
Merged

improvement(url-state): migrate list search/sort/filter view-state to nuqs#5648
waleedlatif1 merged 4 commits into
stagingfrom
nuqs-url-state-fixes

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Migrate shareable list view-state (search, sort, filters, selected-entity id) from useState to nuqs URL params across knowledge, files, logs, skills, and settings
  • Knowledge list: new search-params.ts — search, connector/content/owner filters, sort+dir; add the required Suspense boundary on the page entry
  • Files list: add search, nullable sort+dir, and type/size/uploaded-by filter params in a separate history: 'replace' group so filter writes never pollute the back stack (folder navigation keeps push)
  • Logs: add sort+dir params so sorted views deep-link and fetch correctly on load
  • Skills: add search param alongside the existing skillId
  • Settings: fix workflow-mcp-servers reading mcpServerId via useSearchParams into useState (selection now writes the URL, back closes the detail view); migrate six settings search boxes to nuqs with debounced URL writes
  • Consolidate the per-component settings search-param definitions (incl. teammates) into one shared settings/components/search-params.ts

Type of Change

  • Improvement

Testing

Typecheck + biome clean; behavior semantics (debounce timing, default sort orderings, folder name/asc fallback in files) preserved exactly

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 14, 2026 12:36am

Request Review

@cursor

cursor Bot commented Jul 13, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Client-only URL state and Suspense boundaries; behavior is intended to match prior debounce and sort semantics with no auth or API contract changes.

Overview
Moves shareable list view-state (search, sort, filters, and some selection ids) from local useState to nuqs URL query params across workspace lists and settings, so filtered/sorted views deep-link and survive refresh.

Knowledge and Files gain typed search-params modules: search (debounced URL writes, instant inputs), multi-select filters, and sort/dir. Files keeps folder navigation on history: 'push' while filter/sort writes use a separate history: 'replace' group so the back stack isn’t polluted. Files sort params stay nullable so “no active sort” (files vs folders default ordering) stays distinct from an explicit sort.

Logs adds URL-backed sort/dir wired into the list fetch (defaults match server ordering; UI still treats default as “no active sort”). Skills adds a debounced search param alongside existing skillId.

Settings consolidates list search into shared settings/components/search-params.ts (replacing per-section defs like teammates). API keys, copilot, custom tools, MCP, secrets, teammates, and workflow MCP servers use debounced search in the URL. Workflow MCP servers and MCP detail selection moves from useSearchParams + useState to nuqs (mcpServerId); closing detail uses history: 'replace' so Back leaves the section; workflow MCP handles stale ids gracefully.

Next.js Suspense wraps Account settings renderer and Knowledge page entry where nuqs/useSearchParams requires it (Knowledge uses KnowledgeLoading as fallback).

Reviewed by Cursor Bugbot for commit 422cfd4. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR moves shareable list view state into URL query params with nuqs. The main changes are:

  • Search, sort, and filters for files, knowledge, logs, skills, and settings lists.
  • Suspense boundaries for pages that now read URL search params.
  • URL-backed workflow MCP server selection with stale-id list fallback.
  • Shared settings search-param definitions.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/settings/components/workflow-mcp-servers/workflow-mcp-servers.tsx Moves workflow MCP search and selected server state to nuqs and gates detail rendering on a resolvable server id.
apps/sim/app/workspace/[workspaceId]/settings/components/search-params.ts Adds shared settings search query-param definitions for settings list components.

Reviews (4): Last reviewed commit: "fix(url-state): explicit Suspense bounda..." | Re-trigger Greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 422cfd4. Configure here.

@waleedlatif1 waleedlatif1 merged commit 3e97589 into staging Jul 14, 2026
18 checks passed
@waleedlatif1 waleedlatif1 deleted the nuqs-url-state-fixes branch July 14, 2026 00:46
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