fix: guard session_diff with Array.isArray() + WIP browser panel#21094
fix: guard session_diff with Array.isArray() + WIP browser panel#21094pvldmitriev wants to merge 1 commit intoanomalyco:devfrom
Conversation
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: Found potentially related PRs:
These PRs may address overlapping issues with session diff handling and type safety, though they appear to be from an earlier phase. Your current PR (21094) appears to be the latest comprehensive fix with Array.isArray guards. |
…sh + WIP browser panel
The desktop app crashed with "TypeError: e.diffs.map is not a function" because
session_diff store could hold non-array values (e.g. {} from reconcile() edge cases).
Replaced all `?? []` guards with `Array.isArray()` checks across 5 files.
Also includes WIP browser panel feature: Tauri webview commands, browser UI panel,
platform API, layout integration, and Rust browser.rs module with fixed type errors.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ec20703 to
7756294
Compare
Summary
TypeError: e.diffs.map is not a function— replaced?? []withArray.isArray()guards across all session_diff consumers (5 files). Root cause: SolidJSreconcile()can return{}instead of[]for non-wrappable initial state, and?? []doesn't catch truthy non-arrays.browser.rs(or_elseclosures), removed unimplementedget_browser_urlfrom specta commands.Files changed
Crash fix (Array.isArray guards)
packages/app/src/components/prompt-input.tsxpackages/app/src/context/global-sync/event-reducer.tspackages/app/src/pages/session.tsxpackages/app/src/pages/session/session-side-panel.tsxpackages/app/src/pages/session/use-session-commands.tsxWIP browser panel
packages/app/src/components/browser/native-browser.tsx(new)packages/app/src/pages/session/browser-panel.tsx(new)packages/desktop/src-tauri/src/browser.rs(new)packages/desktop/src-tauri/src/lib.rspackages/desktop/src/index.tsxpackages/desktop/src/bindings.tspackages/app/src/context/layout.tsxpackages/app/src/context/platform.tsxTest plan
bun typecheck— 13/13 packages passbun run test:unit(packages/app) — 299 pass, 0 faildiffs.mapcrash🤖 Generated with Claude Code