Skip to content

Add web browser mode reusing core services - #11

Merged
gis2all merged 6 commits into
mainfrom
codex/web-ui
Sep 7, 2026
Merged

gis2all merged 6 commits into
mainfrom
codex/web-ui

Conversation

@gis2all

@gis2all gis2all commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add a Node HTTP + SSE backend (server/) that reuses core/ and main/services/, serving the same renderer as a web app.
  • Add a browser transport (renderer/web/api.ts) implementing the same FocusFlowApi over POST /api/rpc and SSE /api/events.
  • Adapt the renderer for web mode: centered responsive card layout, hide desktop-only window controls and settings, add a favicon.
  • Add web build/dev tooling (npm run web:dev / web:build / web:start).
  • Use a theme-aware BrowserWindow background color (light/dark).
  • Refresh CLAUDE.md and README.md for web mode; make code-review-graph optional.

Notes / Boundaries

  • Web data uses a separate SQLite database (%USERPROFILE%\.focusflow-web\focusflow.sqlite), independent from the desktop userData database.
  • The web service binds 127.0.0.1 with no auth by default; exposing it requires explicit config.
  • The Electron desktop app is unchanged; web mode is the same renderer with a different transport.

Verification

  • npm test (33 files, 200 tests)
  • npm run test:e2e
  • npm run build
  • git diff --check

Reuse core and main/services for a Node backend that serves the same
renderer as a web app:
- server/index.ts: HTTP + SSE server (POST /api/rpc, GET /api/events),
  static hosting of output/build/renderer, 1s timer tick, hardened static
  path serving.
- server/rpc.ts: channel dispatch mirroring IPC_CHANNELS, reusing
  main/ipc requestValidation and settingsUpdateRequest.
- server/composition.ts, clock.ts, noopPorts.ts: service wiring and no-op
  notification/sound/auto-launch/theme ports.
- server/rpc.test.ts: dispatch coverage.
- vite.server.config.ts, tsconfig.json, vitest.config.ts: server build and
  test/coverage wiring.
…notify

- renderer/web/api.ts: implements FocusFlowApi over POST /api/rpc and SSE
  /api/events; system.* degrade to no-ops; theme resolved via matchMedia.
- renderer/web/notify.ts: client-side completion notification and beep.
- renderer/main.tsx: install the web transport when the Electron preload
  bridge is absent and flag data-focus-flow-web for web-only styling.
- renderer/main.test.tsx: cover the new entry behavior.
- renderer/styles/tokens.css: centered responsive card layout only under
  data-focus-flow-web (desktop keeps the original full-bleed layout).
- renderer/components/WindowTitleBar.tsx: hide window controls on web.
- renderer/views/SettingsView.tsx: hide desktop-only settings on web
  (startup/window group and close-to-tray).
- renderer/index.html + renderer/public/favicon.svg: web tab icon.
- package.json: web:dev / web:build / web:start scripts.
- vite.web.config.ts: dev Vite config with /api proxy to the API server.
- tools/web-dev.mjs: build + run the API server and the renderer dev server.
Resolve the window background from the effective theme (light #ffffff,
dark #08192a) instead of the fixed light blue, and update it when the
theme changes (settings update or system theme).
- CLAUDE.md: integrate web mode (server/, renderer/web, Web boundary,
  web commands, routing, verification); make code-review-graph optional;
  update test baseline.
- README.md: merge web mode into the intro/structure, rework
  development & verification into a concise table.
@gis2all
gis2all merged commit 449bbfe into main Sep 7, 2026
2 checks passed
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