Commit Graph

6 Commits

Author SHA1 Message Date
gsxdsm
d01fb6a01e feat(FN-2220): merge fusion/fn-2220 2026-04-22 01:31:40 -07:00
gsxdsm
1cbf9e1015 test: enforce test-directory isolation across all packages
Introduce a shared test-utils module and global vitest setup that
guarantee tests never write to the real .fusion directory or leak temp
directories under /tmp.

Infrastructure:
- packages/core/src/__test-utils__/workspace.ts — tempWorkspace(),
  useIsolatedCwd(), trackForCleanup(), assertOutsideRealFusion() with
  auto-cleanup in afterEach.
- packages/core/src/__test-utils__/vitest-setup.ts — per-worker guard:
  chdirs each worker into an isolated tmp dir, wraps process.chdir to
  refuse the real .fusion, scopes tmp dirs under fusion-test-workers/
  (skips cwd change in thread-pool workers where chdir isn't supported).
- packages/core/src/__test-utils__/vitest-teardown.ts — globalSetup
  hook that wipes the shared parent even when workers are SIGKILLed.
- scripts/check-test-isolation.mjs + `test:isolated` / `test:check-
  isolation` scripts for CI.
- @fusion/test-utils alias + setupFiles + globalSetup wired into core,
  cli, engine, dashboard, tui vitest configs; matching tsconfig paths.

Test refactors (no behavior change):
- cli provider-settings, auth-paths, provider-auth — switch leaking
  mkdtempSync calls to tempWorkspace().
- core migration, first-run, store-backward-compat — replace manual
  process.chdir save/restore with useIsolatedCwd().
- tui fusion-context — replace 9 hardcoded tmp paths (collision-prone
  under parallelism) with tempWorkspace().
- dashboard useTheme, FileBrowser, TaskCard — resolve source-file reads
  against a PACKAGE_ROOT computed from import.meta.url instead of cwd,
  so tests don't depend on the process working directory.

Verified: full suite (~15,500 tests across 8 packages + plugins) passes
and the orphan-detector reports zero leaked temp directories after a
complete run.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 23:41:47 -07:00
gsxdsm
51e23786c0 fix(dashboard): ensure file/import API calls are project-scoped in tests
Update 4 test files to pass projectId="project-1" to hooks/components
and assert it flows through to the API layer:
- useFileBrowser: fetchFileList receives (taskId, path, projectId)
- useFileEditor: fetchFileContent/saveFileContent receive projectId
- FileBrowser: deleteFile/renameFile/copyFile/moveFile receive projectId
- GitHubImportModal: apiImportGitHubIssue/Pull receive projectId

All 6653 tests pass across 242 test files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 21:40:34 -07:00
gsxdsm
7a60e03282 fix(FN-1310): remove mobile 44px touch target enforcement from FileBrowser
- Remove min-height/min-width 44px enforcement from FileBrowser styles.css that was overriding native sizing
- Update FileBrowser test to match the actual CSS without mobile touch target rules
- Update memory log with the change rationale
2026-04-09 07:07:49 -07:00
gsxdsm
af57015181 feat(FN-1137): improve mobile dropdown and file browser interactions
- Add viewport-aware positioning/clamping for Quick Scripts and Quick Entry dropdown menus
- Implement long-press context menu behavior in FileBrowser with iOS momentum scrolling support
- Expand dashboard CSS and component logic to stabilize mobile overlay behavior and remove unused inline WebKit style
- Add focused tests for FileBrowser, QuickScriptsDropdown, and mobile dropdown positioning plus README notes
2026-04-08 05:59:12 -07:00
gsxdsm
81e4eb002b feat(FN-943): add file browser context menu with copy, move, delete, rename, and download operations
- Add backend file operations (copy, move, delete, rename, download) in file-service.ts with workspace root protection
- Add API routes for file operations including directory download as zip via archiver
- Add client API functions in api.ts for all file operation endpoints
- Add context menu UI in FileBrowser component with operations dialog for confirming destructive actions
- Add CSS styles for context menu including danger items and dividers
- Add 33 FileBrowser context menu tests and 485+ file-service tests
- Fix pre-existing test failures in routes-diff, mission-e2e, and theme sync tests
2026-04-05 20:54:11 -07:00