Skip to content

feat(cad): prompt to sync a local cad file that changed on disk - #216

Merged
AadiJo merged 1 commit into
mainfrom
local-cad-changed-prompt
Nov 8, 2026
Merged

AadiJo merged 1 commit into
mainfrom
local-cad-changed-prompt

Conversation

@AadiJo

@AadiJo AadiJo commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

When a local CAD file was saved or re-exported, nothing in Cadsense said so. The model stayed on the old revision until someone remembered to press Sync, and the agent reviewed stale geometry without knowing.

Now the CAD panel checks the linked file when it opens, after each new snapshot, and whenever the window regains focus. If the file no longer matches the shown snapshot, the Sync icon becomes an accent Sync changes label, the same treatment the panel gives the first sync during onboarding, and its tooltip says the file changed on disk. cad_context gives the agent the same answer as localFileStatus, so it can ask the user to sync, since CAD cannot sync while the agent runs.

  • LocalCadImport.sourceStatus hashes the files the way an import does (sourceFiles, then localCadFilesMicroversionId). A change to any file a SolidWorks assembly uses counts, and a Sync always clears the prompt. Bytes are hashed again only when a file's size or mtime moved, so saving identical bytes again stays unchanged.
  • New read-scoped RPC localCad.source.check({ projectId, rootId }). It never fails: anything it cannot compare is unavailable, and the button stays plain.
  • CadViewing now needs LocalCadImport. server.ts shares one LocalCadImport layer by reference between the acquisition and viewing layers, so each server still has one SolidWorks bridge.
  • There is no file watcher. A change made while the window keeps focus shows at the next focus or snapshot. LocalCad.md lists the limits.

Proof: local-cad-project-e2e.ts passes end to end. Its re-export step now checks that there is no prompt before the file changes, that Sync changes appears after the rewrite and a window focus, and that it clears after the sync. New tests in LocalCadProjects.test.ts (unchanged, touched, changed, synced, missing) and CadMcpReviews.test.ts (cad_context) failed before the change. Typecheck, lint, and the affected server and web suites pass. A recorded run in the dev app, on a project's draft, checked the same three states and that Sync changes has the onboarding accent class.

Reviewed with sol-loop: 3 rounds with gpt-6.1-sol. Sol verdict: approved


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@vercel

vercel Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
cadsense Ready Ready Preview Nov 8, 2026 11:11pm UTC

@AadiJo
AadiJo force-pushed the local-cad-changed-prompt branch from 3e050b8 to d8340ef Compare November 8, 2026 23:10
@AadiJo
AadiJo merged commit ba4e893 into main Nov 8, 2026
12 checks passed
@AadiJo
AadiJo deleted the local-cad-changed-prompt branch November 26, 2026 19:51

This branch was successfully deployed

1 active deployment
Preview — d8340efc Deployed Nov 8, 2026 by vercel[bot]
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