improvement(ui): fix nav loading flash, skeleton mismatches, and React anti-patterns across resource pages#3864
Conversation
…t anti-patterns across resource pages - Convert knowledge, files, tables, scheduled-tasks, and home page.tsx files from async server components to simple client re-exports, eliminating the loading.tsx flash on every navigation - Add client-side permission redirects (usePermissionConfig) to knowledge, files, and tables components to replace server-side checks - Fix knowledge loading.tsx skeleton column count (6→7) and tables loading.tsx (remove phantom checkbox column) - Fix connector document live updates: use isConnectorSyncingOrPending instead of status === 'syncing' so polling activates immediately after connector creation - Remove dead chunk-switch useEffect in ChunkEditor (redundant with key prop remount) - Replace useState+useEffect debounce with useDebounce hook in document.tsx - Replace useRef+useEffect URL init with lazy useState initializers in document.tsx and logs.tsx - Make handleToggleEnabled optimistic in document.tsx (cache first, onError rollback) - Replace mutate+new Promise wrapper with mutateAsync+try/catch in base.tsx - Fix schedule-modal.tsx: replace 15-setter useEffect with useState lazy initializers + key prop remount; wrap parseCronToScheduleType in useMemo - Fix logs search: eliminate mount-only useEffect with eslint-disable by passing initialQuery to useSearchState; parse query once via shared initialParsed state - Add useWorkspaceFileRecord hook to workspace-files.ts; refactor FileViewer to self-fetch - Fix value: any → value: string in useTagSelection and collaborativeSetTagSelection - Fix knowledge-tag-filters.tsx: pass '' instead of null when filters are cleared (type safety)
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Shifts tab visibility enforcement to the client by adding Fixes several UI/state issues: skeleton column mismatches (Knowledge, Tables), more robust connector polling by treating newly-created connectors as pending sync, optimistic chunk enable/disable with rollback on error, and removes mount-only Written by Cursor Bugbot for commit 3d5b7f2. Configure here. |
apps/sim/app/workspace/[workspaceId]/knowledge/[id]/[documentId]/document.tsx
Show resolved
Hide resolved
…th useWorkspaceFiles
|
@cursor review |
|
greptile |
Greptile SummaryThis PR is a broad quality pass across the workspace resource pages, addressing a noticeable full-page skeleton flash on tab navigation, several React anti-patterns, and a handful of UI/state bugs. Key changes:
Confidence Score: 5/5Safe to merge — all prior review concerns are addressed and no new P0/P1 issues were found. All three previously-raised concerns (fileId missing from query key, ScheduleModal key-based remount contract, FileViewer silent null) are resolved with JSDoc or explicit design acknowledgement. The only remaining finding is a P2 style suggestion in schedule-modal.tsx — no data loss, broken paths, or security issues identified. schedule-modal.tsx — useMemo/useState initializer style concern (P2 only) Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["page.tsx server re-export"] --> B["Client Component"]
B --> C{usePermissionConfig}
C -- tab hidden --> D["router.replace to workspace"]
C -- tab visible --> E["Render UI"]
subgraph warmPath["Warm path"]
F["useWorkspaceFileRecord"] --> G["React Query list cache hit"]
G --> H["select by fileId"]
end
subgraph coldPath["Cold path"]
F --> I["fetchWorkspaceFiles full list"]
I --> H
end
subgraph modalRemount["ScheduleModal remount"]
J["key prop on ScheduleModal"] --> K["Remount on task switch"]
K --> L["useState lazy initializers run once"]
end
subgraph connectorFix["Connector polling fix"]
M["isConnectorSyncingOrPending"] --> N["Polling activates on pending and syncing"]
O["old: status syncing only"] --> P["Missed fresh connector pending state"]
end
Reviews (3): Last reviewed commit: "fix(scheduled-tasks): correct useMemo de..." | Re-trigger Greptile |
.../workspace/[workspaceId]/scheduled-tasks/components/create-schedule-modal/schedule-modal.tsx
Show resolved
Hide resolved
…s to useWorkspaceFileRecord, document key remount requirement in ScheduleModal
|
@greptile |
|
@cursor review |
apps/sim/app/workspace/[workspaceId]/files/[fileId]/view/file-viewer.tsx
Show resolved
Hide resolved
.../workspace/[workspaceId]/scheduled-tasks/components/create-schedule-modal/schedule-modal.tsx
Show resolved
Hide resolved
apps/sim/app/workspace/[workspaceId]/knowledge/[id]/[documentId]/document.tsx
Show resolved
Hide resolved
|
@greptile |
|
@cursor review |
|
@cursor review |
Summary
Type of Change
Testing
Tested manually
Checklist