mirror of
https://github.com/priyanshujain/margin-calendar.git
synced 2026-10-02 11:07:04 +00:00
Tauri 2, React 19 and zustand on the front, Rust behind. Rust owns auth, all HTTP to Google, the SQLite store, the sync loop, recurrence expansion and timezone maths. TypeScript owns rendering and never talks to Google, which keeps the content security policy locked to ipc:. Week, day and agenda views, and no month view: it would be a second layout engine, and the fit and fold logic that makes a day fit the window without scrolling is the whole point of the app. Runs on macOS, Linux, Android and iOS. Desktop catches Google's OAuth redirect on a loopback port. A phone cannot, and Google rejects loopback for mobile client types anyway, so it redirects to a custom URI scheme and needs its own public OAuth clients, which docs/mobile.md covers. Refresh tokens are sealed with XChaCha20-Poly1305 in the app data directory on every platform, with no OS credential store in the picture. On a phone the chrome becomes a top bar and a bottom tab bar, overlays become sheets, hover affordances become taps, and dragging out an event waits for a long press. Navigation moves one day at a time everywhere, a swipe included.
54 lines
2.1 KiB
TypeScript
54 lines
2.1 KiB
TypeScript
// The end-to-end suite drives the real UI in a browser, where `src/ipc.ts` routes every command to
|
|
// the dev fixture. One command starts everything: `pnpm test:ui` brings up Vite itself and reuses a
|
|
// dev server that is already running.
|
|
//
|
|
// The viewport is fixed, because half of what these tests assert is geometry: block heights, the
|
|
// solved row height, whether the axis moved. A test that measured a window of unknown size would
|
|
// be asserting nothing.
|
|
|
|
import { defineConfig } from "@playwright/test";
|
|
|
|
const PORT = 1430;
|
|
const BASE_URL = `http://localhost:${PORT}`;
|
|
|
|
export default defineConfig({
|
|
testDir: "./tests",
|
|
fullyParallel: true,
|
|
// No retries on purpose. A test that only passes on the second go is a test that is lying about
|
|
// something, and this suite exists because things that looked fine were not.
|
|
retries: 0,
|
|
reporter: [["list"]],
|
|
// Traces and failure screenshots go somewhere already ignored, so a run cannot leave anything
|
|
// behind for the next `git add` to pick up. The paths are printed with the failure that made
|
|
// them.
|
|
outputDir: "node_modules/.cache/playwright",
|
|
timeout: 30_000,
|
|
expect: { timeout: 5_000 },
|
|
|
|
use: {
|
|
baseURL: BASE_URL,
|
|
viewport: { width: 1440, height: 900 },
|
|
deviceScaleFactor: 1,
|
|
// The fixture is anchored to the browser's local day, so pinning the zone keeps a run on one
|
|
// machine comparable with a run on another. Nothing in the suite depends on the zone itself.
|
|
timezoneId: "Asia/Kolkata",
|
|
locale: "en-GB",
|
|
trace: "retain-on-failure",
|
|
screenshot: "only-on-failure",
|
|
},
|
|
|
|
// Deliberately not `devices["Desktop Chrome"]`: that device pins a Windows user agent, and the
|
|
// keymap reads the platform off the user agent to decide whether the primary modifier is Command
|
|
// or Control. A faked platform would test the wrong half of every shortcut.
|
|
projects: [{ name: "chromium", use: { browserName: "chromium" } }],
|
|
|
|
webServer: {
|
|
command: "pnpm dev",
|
|
url: BASE_URL,
|
|
reuseExistingServer: true,
|
|
timeout: 60_000,
|
|
stdout: "ignore",
|
|
stderr: "pipe",
|
|
},
|
|
});
|