1
0
Fork 0
forked from dries/ocman

test(frontend): harden browser storage and wails linting #5

Closed
peter wants to merge 1 commit from codex/frontend-test-lint-hygiene into main
Owner

Summary

  • Guard message bookmark storage when window.localStorage is missing or throws in non-browser/test environments.
  • Exclude Wails-generated bindings/runtime under src/wailsjs/** from ESLint.

Actual issue observed

While validating the stack, frontend tests failed in SessionDetail.integration.test.tsx with:

TypeError: Cannot read properties of undefined (reading 'removeItem')

The failure happened in saveMessageBookmarks, where the code assumed window.localStorage was always present before checking removeItem / setItem.

We also had Wails-generated bindings/runtime under frontend/src/wailsjs/; that directory is configured as Wails' generated JS output in wails.json and is already gitignored.

What we inferred / assumed

  • We inferred message bookmark persistence should be best-effort: if browser storage is unavailable, bookmarks should simply not persist rather than breaking SessionDetail rendering.
  • We assumed this guard should stay local to message bookmark storage instead of changing unrelated localStorage users in this PR.
  • We assumed everything under frontend/src/wailsjs/ is generated Wails output, so handwritten wrappers/helpers should live elsewhere if needed.
  • We put this first in the stack because it makes full make test validation meaningful for the backend PRs above it.

Stack

Base: main. Next PR: codex/opencode-port-affinity (#4).

Validation

Run on codex/frontend-test-lint-hygiene:

  • cd frontend && pnpm lint — passed.
  • make test — passed (105 frontend test files, 1276 frontend tests).

Run on the stack tip after rebasing dependent branches:

  • make test — passed (105 frontend test files, 1277 frontend tests).

Note: make lint currently reaches an unrelated base-branch host-helper check failure in internal/server/loop_engine.go; this PR does not touch that path.

## Summary - Guard message bookmark storage when `window.localStorage` is missing or throws in non-browser/test environments. - Exclude Wails-generated bindings/runtime under `src/wailsjs/**` from ESLint. ## Actual issue observed While validating the stack, frontend tests failed in `SessionDetail.integration.test.tsx` with: `TypeError: Cannot read properties of undefined (reading 'removeItem')` The failure happened in `saveMessageBookmarks`, where the code assumed `window.localStorage` was always present before checking `removeItem` / `setItem`. We also had Wails-generated bindings/runtime under `frontend/src/wailsjs/`; that directory is configured as Wails' generated JS output in `wails.json` and is already gitignored. ## What we inferred / assumed - We inferred message bookmark persistence should be best-effort: if browser storage is unavailable, bookmarks should simply not persist rather than breaking SessionDetail rendering. - We assumed this guard should stay local to message bookmark storage instead of changing unrelated `localStorage` users in this PR. - We assumed everything under `frontend/src/wailsjs/` is generated Wails output, so handwritten wrappers/helpers should live elsewhere if needed. - We put this first in the stack because it makes full `make test` validation meaningful for the backend PRs above it. ## Stack Base: `main`. Next PR: `codex/opencode-port-affinity` (#4). ## Validation Run on `codex/frontend-test-lint-hygiene`: - `cd frontend && pnpm lint` — passed. - `make test` — passed (`105` frontend test files, `1276` frontend tests). Run on the stack tip after rebasing dependent branches: - `make test` — passed (`105` frontend test files, `1277` frontend tests). Note: `make lint` currently reaches an unrelated base-branch host-helper check failure in `internal/server/loop_engine.go`; this PR does not touch that path.
peter force-pushed codex/frontend-test-lint-hygiene from ec8272f83b to f32a754653 2026-06-23 19:21:01 +02:00 Compare
peter force-pushed codex/frontend-test-lint-hygiene from f32a754653 to 4723ccad95 2026-06-23 19:48:49 +02:00 Compare
peter force-pushed codex/frontend-test-lint-hygiene from 4723ccad95 to 9e7a35fd1b 2026-06-24 09:01:36 +02:00 Compare
peter force-pushed codex/frontend-test-lint-hygiene from 9e7a35fd1b to 2da8e97641 2026-06-24 12:00:55 +02:00 Compare
peter force-pushed codex/frontend-test-lint-hygiene from 2da8e97641 to 40ff02caa3 2026-06-24 12:16:48 +02:00 Compare
peter force-pushed codex/frontend-test-lint-hygiene from 40ff02caa3 to 18241024b6 2026-06-24 12:23:04 +02:00 Compare
peter changed target branch from codex/opencode-port-affinity to main 2026-06-24 12:23:46 +02:00
peter force-pushed codex/frontend-test-lint-hygiene from 18241024b6 to b9050c646d 2026-06-24 12:44:03 +02:00 Compare
peter closed this pull request 2026-06-25 08:59:24 +02:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
peter/ocman!5
No description provided.