Skip to content

fix(types): close 3 svelte-check errors — sessions prop + invoke mock (#214 PR4)#227

Merged
tylergraydev merged 1 commit into
mainfrom
fix/ts-errors-test-fixtures
May 16, 2026
Merged

fix(types): close 3 svelte-check errors — sessions prop + invoke mock (#214 PR4)#227
tylergraydev merged 1 commit into
mainfrom
fix/ts-errors-test-fixtures

Conversation

@tylergraydev

Copy link
Copy Markdown
Owner

Part of the #214 cleanup. Brings npm run check from 53 → 50 errors (closes 3). Scoped to the two genuinely mechanical fixes from #214's proposed PR4 — groups E and M turned out to need real investigation (see below).

Changes

Group File Fix
H routes/sessions/+page.svelte Passed sessionSummary={sessionStore.selectedSessionSummary} to SessionDetailPanel. Neither side exists anymore — SessionStoreState has no selectedSessionSummary, and SessionDetailPanel's Props is { detail, onClose }. The prop was already dead; removed the line.
K tests/helpers/invokeMock.ts Typed the invoke mock implementation's args as Record<string, unknown>. Tauri's invoke is (cmd, args?: InvokeArgs, …) and InvokeArgs is wider (e.g. number[]), so the narrower callback param made the mock unassignable. Widened to InvokeArgs, cast at the boundary where it's handed to the ergonomic handler.

Deferred from #214's PR4 grouping

#214 grouped E + H + K + M as "test-fixture cleanup, low risk." H and K are — E and M aren't:

  • Group E (keybindings "Input" context, 6 errors) — the tests pass at runtime (31/31) but reference 'Input', which is in neither KEYBINDING_CONTEXTS nor KEYBINDING_ACTIONS; they only pass via cross-test override state leakage. Adding 'Input' to the KeybindingContext union would be a phantom-value behavior change; rewriting the tests needs care around those state dependencies. Worth its own PR.
  • Group M (AgentMemoryPanel selectedProject, 1 error) — a latent runtime bug, not type drift. projectsStore (ProjectsState) has no project-selection concept at all, so projectsStore.selectedProject?.path ?? null always evaluates to null — the panel's project-scope agent memory silently never receives a path. Fixing it means deciding how the panel learns the current project (prop vs. route param) — a design call, not a fixture edit.

Test plan

  • npm run check — 50 errors (down from 53 on main)
  • npx vitest run — sessionStore + invokeMock consumers pass
  • Zero new errors

🤖 Generated with Claude Code

…#214 PR4)

Part of the #214 cleanup. Brings `npm run check` from 50 -> 47 errors
(closes 3). Scoped to the two genuinely mechanical fixes from #214's
proposed PR4 — groups E and M turned out to need real investigation,
see below.

## Changes

- **Group H** — `routes/sessions/+page.svelte` passed
  `sessionSummary={sessionStore.selectedSessionSummary}` to
  `SessionDetailPanel`. Neither side exists anymore: `SessionStoreState`
  has no `selectedSessionSummary`, and `SessionDetailPanel`'s `Props` is
  `{ detail, onClose }`. The prop was already dead — removed the line.
- **Group K** — `tests/helpers/invokeMock.ts` typed the `invoke`
  mock implementation's `args` as `Record<string, unknown>`. Tauri's
  `invoke` signature is `(cmd, args?: InvokeArgs, ...)` and `InvokeArgs`
  is wider (e.g. `number[]`), so the narrower callback param made the
  mock unassignable. Widened to `InvokeArgs` and cast at the boundary
  where it's handed to the ergonomic `handler` callback.

## Deferred from #214's PR4 grouping

- **Group E** (keybindings `"Input"` context, 6 errors) — not a fixture
  cleanup. The tests pass at runtime (31/31) but reference `'Input'`,
  which is in neither `KEYBINDING_CONTEXTS` nor `KEYBINDING_ACTIONS`;
  they only pass via cross-test override state. Adding `'Input'` to the
  `KeybindingContext` union would be a phantom-value behavior change;
  rewriting the tests needs care around their state dependencies.
- **Group M** (`AgentMemoryPanel` `selectedProject`, 1 error) — a latent
  runtime bug, not drift. `projectsStore` has no project-selection
  concept at all, so `projectsStore.selectedProject?.path ?? null` is
  always `null` — the panel's project-scope memory silently never gets
  a path. Needs a data-flow decision (prop vs. route param).

## Test plan

- [x] `npm run check` — 50 errors (down from 53 on `main`)
- [x] `npx vitest run` (sessionStore + helpers consumers) — pass
- [x] Zero new errors

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tylergraydev tylergraydev merged commit 85d9921 into main May 16, 2026
10 checks passed
tylergraydev added a commit that referenced this pull request May 16, 2026
Rebased onto current main. The original commit also included fixes
for preexisting type errors across usageStore/skill/invokeMock/etc.,
but main has since landed canonical fixes for all of them (#221, #226,
#227, #236), so those parts of the original commit are dropped.

Net change: WSL2-specific Rust code (utils/wsl.rs, services/wsl_config.rs)
plus the settings/config plumbing to expose WSL editors in the UI.

See PR #149 for full description.
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