37 Commits

Author SHA1 Message Date
jbrechtel 1c19d97dc8 feat: add Playwright e2e smoke test covering signup → household → chore flow
- Added smoke.spec.js with Playwright test for full user flow:
  1. Sign up (fill form, submit, click 'Go to Dashboard')
  2. Create household (fill name, submit)
  3. Create chore (fill name + date, submit)
  4. Verify session persistence (revisit dashboard)
- Server now supports --db flag for temp databases and SIS_FRESH_DB env
  to delete the db file on startup (for clean test runs)
- Server reads SIS_PORT env var for port configuration
- scripts/test-e2e: starts server with fresh db, runs tests, cleans up
- playwright.config.js: minimal config pointing at test/e2e/
2026-07-16 10:01:33 -04:00
jbrechtel 6bea83be7d fix: wrap all update action views in pageLayout so navbar persists on WebSocket updates
HyperView update actions replace only the hyper component — without pageLayout
the navbar disappears after any interactive action (create chore, navigate pages,
refresh, create household, etc.). Every hyper-returning update now wraps the
view in pageLayout us.
2026-07-16 09:27:36 -04:00
jbrechtel 92f076f329 chore: remove db migration support — fold household_id into users table definition
- Added household_id column directly to users CREATE TABLE
- Removed ALTER TABLE migration hack and Control.Exception/ScopedTypeVariables
- Renamed runMigrations to createTables (now internal, unexported)
- Tables created from scratch if database doesn't exist; no migration logic
2026-07-16 09:22:03 -04:00
jbrechtel b5ff79fc76 feat: chore creation form with one-off schedule and assignee picker
- Replaced CNewChore placeholder with a full creation form
- Form includes: chore name (text input), date (date picker for one-off),
  assignee (dropdown with Anyone + household members)
- CNewChore action shows choresViewWithForm (list + form inline)
- CCreateChore processes form data, parses date to ScheduleOneOff,
  parses assignee to ChoreAssignee, calls createChore
- Cancel button (CRefreshChores) returns to list-only view
- parseSchedule: reads YYYY-MM-DD date string into ScheduleOneOff
- parseAssignee: parses 'anyone' or 'user:<id>' into ChoreAssignee
2026-07-16 09:18:10 -04:00
jbrechtel 5485bdfd0b feat: household creation form — users without a household see a name input and Create Household button
- Added userHouseholdId (Maybe HouseholdId) to User type
- Added household_id FK column to users table via migration (idempotent)
- CreateHousehold now also sets household_id on the creating user
- SetUserHousehold DB effect for explicit FK updates
- noHouseholdView replaced with a proper Hyperbole form using HouseholdFormData
- On submit, creates household + membership + sets user FK, then redirects to household view
2026-07-16 09:11:09 -04:00
jbrechtel 02044642a7 feat: rebuild navbar with NB structure — Sis brand, nav links with nb-navbar-link class inside nb-navbar-item wrappers, user initials avatar
- UserSession now carries usDisplayName for extracting initials (current: JB)
- Nav items: Today (was Dashboard), Chores, Activity, Household
- Removed Logout link; added black user avatar circle with initials
- routeLink generates proper <li class='nb-navbar-item'><a class='nb-navbar-link'> structure
- All pages wrapped with pageLayout to render shared navbar shell
- Login/Signup save display name into session on authentication
2026-07-16 09:05:56 -04:00
jbrechtel bcdda0754b fix: set cookieSecure=False so session persists on HTTP (localhost)
The UserSession cookie was defaulting to secure=True which prevents
browsers from sending it on non-HTTPS connections. This caused the
dashboard to redirect back to login on every click.

Verified with Playwright: login, dashboard link click, and navbar
navigation all preserve the session correctly.
2026-07-16 07:48:10 -04:00
jbrechtel dbfe3a7c66 chore: fix all hlint warnings, update AGENTS.md pre-commit checklist
- Fix 8 hlint hints across 6 files (unused pragma, newtype, lambda, redundant brackets/\$)
- Add blank line after LANGUAGE pragma in Route.hs (fourmolu)
- Fix HouseholdFormData deriving to use explicit strategies for newtype
- Update AGENTS.md: require hlint clean before every commit, add pre-commit checklist
  (format, lint, build, test), update NB CSS URL to jsdelivr CDN
2026-07-16 07:43:38 -04:00
jbrechtel 95ac550191 fix: update to correct NeoBrutalismCSS CDN and class names
- Switch CDN to jsdelivr (matches design spec)
- Use nb-card, nb-card-title, nb-button default, nb-checkbox, nb-navbar-link
- Add Google Fonts import for Lexend Mega
- Style all route links as nb-button default buttons
- Fix navbar to use nb-navbar-brand and nb-navbar-nav
- Update style.css for new NB version compatibility
2026-07-16 07:34:45 -04:00
jbrechtel e8036bab11 chore: cleanup trailing empty lines from sed operations 2026-07-16 07:30:37 -04:00
jbrechtel 456eae4717 fix: login/signup flow working with session-based auth
- Fixed hashPasswordIO to use real PBKDF2 hashing from Sis.Auth
- Added seed route (rseed) for demo data initialization
- Replaced redirect() in update functions with success views
  (redirect uses throwError_ which broke with effectful 2.4)
- Added loginSuccessView and signupSuccessView with dashboard links
- Patched Hyperbole Socket.hs to parse WebSocket form body into Form params
- Patched Hyperbole Wai.hs to include TargetViewId in response metadata
- Fixed View/Page type mismatches (hyper wrapper vs plain view)
- Removed dead pure after redirect calls
- Verified: login submits, session set, success view rendered
2026-07-16 07:27:31 -04:00
jbrechtel a99c239852 fix: add static file serving with custom middleware
- Replaced wai-app-static with lightweight inline static file server
- Static files served from frontend/static/ under /static/ path
- Fixed ByteString/FilePath type mismatches for GHC 9.10
- Verified: CSS, manifest, login, signup, dashboard all HTTP 200
2026-07-16 07:00:41 -04:00
jbrechtel df9ad3d7c4 fix: rename route constructors to avoid type conflicts
- Renamed route constructors: RouteLogin → RLogin, RouteDashboard → RDashboard, etc.
- This fixes ambiguous occurrence errors with Types.Dashboard vs Route.Dashboard
- Fixed Layout.hs navbar links to use new constructor names
- Server verified serving HTML on /login, /rdashboard, etc.
2026-07-16 06:54:18 -04:00
jbrechtel 1d5ecd0829 chore: cleanup TypeScript, update docs, scripts, Dockerfile
- Delete all frontend TypeScript source (src/, index.html, package.json, etc.)
- Move static assets to frontend/static/ (style.css, manifest.json)
- Update scripts/build and scripts/test (no npm steps)
- Update Dockerfile (no frontend build step)
- Update README.md and AGENTS.md for Hyperbole stack
2026-07-16 06:51:11 -04:00
jbrechtel a717d619d3 feat: Hyperbole port compiles and builds successfully
- All page modules now use proper Page es '[ViewId] type with hyper embedding
- Fixed view DSL: tag calls, String/Text conversions, polymorphic context types
- DB effect uses convenience wrappers (lowercase) with send
- HyperView instances have DB :> es, IOE :> es constraints
- Main.hs uses liveAppWith with proper router
- Static file serving deferred (will use nginx or wai-app-static)
- Warning suppressions added where needed
- Build produces working 25MB sis-server binary
2026-07-16 06:50:20 -04:00
jbrechtel c45ae41645 fix: progress on Hyperbole view DSL - form tags, imports, constraints
- Fix tag calls to use \$ none for self-closing tags
- Add IOE constraint to HyperView instances
- Add warning suppressions where needed
- Fix Form data type imports
- Remove duplicate getUserHouseholds helpers
- Remaining issues: String/Text mismatches in text calls,
  a few view DSL type errors in Dashboard/Chores
2026-07-16 06:41:49 -04:00
jbrechtel 7eaf6ab7e7 feat: Hyperbole port - all modules created, Database effect working
- Database.hs: effectful DB effect with all operations + convenience wrappers
- Types.hs: stripped Aeson (kept ToJSON/FromJSON on IDs), added form types
- Route.hs, Style.hs, View/Layout.hs: support modules
- All Page modules: Login, Signup, Dashboard, Chores, Household, Activity
- Main.hs: Hyperbole app entry point with router
- Known issue: Hyperbole view DSL syntax needs cleanup in page modules
  (tag calls need $ none suffix, form elements need field wrappers)
2026-07-16 06:38:34 -04:00
jbrechtel b92947cdcc refactor: strip Aeson from Types, remove Server.hs, fix Sis.hs exports, update deps
- Removed all Aeson instances from Types.hs
- Deleted Server.hs (Orb/WAI routing)
- Added Hyperbole form types (LoginForm, SignupForm, etc.)
- Removed Server from Sis.hs and cabal file
- Updated stack.yaml for Hyperbole dependency resolution
- Added local hyperbole copy with GHC 9.10 compat patches
- Types.hs, Database.hs, Auth.hs compile successfully
2026-07-15 22:44:05 -04:00
jbrechtel 2c55ea9dc1 deps: add hyperbole, effectful, atomic-css; remove orb/mithril deps 2026-07-15 22:35:08 -04:00
jbrechtel aa88f0b3c5 docs: implementation plan for Hyperbole port 2026-07-15 22:24:17 -04:00
jbrechtel de4b48c8e5 docs: design spec for porting Sis to Hyperbole 2026-07-15 22:17:50 -04:00
jbrechtel 194df4d2fe feat: use .nb-button.default styling for nav buttons 2026-07-15 21:45:12 -04:00
jbrechtel 6f24ba0901 docs: add nav button styling design spec 2026-07-15 21:44:40 -04:00
jbrechtel c530fd882a Updates AGENTS.md 2026-07-15 21:31:33 -04:00
jbrechtel 0adeaf9ceb Adding plans and docs 2026-07-15 21:21:21 -04:00
jbrechtel b4e47b652f WIP: backend auth/chores/households work and frontend styling 2026-07-15 21:20:57 -04:00
jbrechtel 08987d7c49 fix: convert login/signup forms to Mithril components
The login and signup forms used factory-function patterns (plain
functions returning vnodes with let-bindings for state). Mithril calls
these on every redraw, creating fresh let-bindings each time, so any
state set by oninput handlers was immediately discarded. This broke
text input in all form fields.

Fix: convert to proper Mithril components using vnode.state for
persistent state across redraws. Mithril auto-redraws after event
handlers, so explicit m.redraw() calls in oninput are unnecessary.
2026-07-15 21:17:46 -04:00
jbrechtel 4358098c57 docs: add AGENTS.md with project conventions 2026-07-15 16:37:36 -04:00
jbrechtel d4f839c491 feat: add SQLite database support
- Add sqlite-simple dependency
- Create Sis.Database module with openDatabase (creates parent dir, enables WAL + FK)
- Add --db-path CLI option (default data/sis.db)
- Format all Haskell sources with fourmolu
- Fix hlint suggestions in Sis.Server
2026-07-15 15:57:44 -04:00
jbrechtel 715889a72a feat: add --db-path CLI option and open SQLite db on startup 2026-07-15 15:55:54 -04:00
jbrechtel 1a8a264eae feat: add Sis.Database module with openDatabase 2026-07-15 15:55:04 -04:00
jbrechtel bef88e789c deps: add sqlite-simple 2026-07-15 15:54:50 -04:00
jbrechtel efd2ccd14a Add SQLite database implementation plan 2026-07-15 15:46:11 -04:00
jbrechtel f5a6517f2c Add SQLite database support design spec 2026-07-15 15:43:46 -04:00
jbrechtel 72b1ee1d3d Add SPA static file serving from backend
Backend (Server.hs):
- serveStaticOrSpa: serves static files from --static-dir
- SPA fallback: extensionless paths serve index.html
- MIME type mapping for html/css/js/png/svg/ico/woff2

Frontend:
- ES module imports with import map for Mithril CDN
- Build script: tsc + copy index.html + static assets

CLI:
- --static-dir flag (default: frontend/dist)
- scripts/run passes through extra args
- Dockerfile CMD points at /usr/local/share/sis/static
2026-07-15 14:59:31 -04:00
jbrechtel 5075ef2718 Add neo-brutalist landing page
Title 'Sis' in nb-font-heading1, tagline 'For chores and stuff'
Warm cream background, centered nb-box layout
2026-07-15 14:52:49 -04:00
jbrechtel 72d94170b4 Initial project skeleton
Haskell backend: Orb HTTP framework, JSON-only API
Frontend: Mithril.js SPA with TypeScript, Neo Brutalism CSS
Dockerized build via flipstone/haskell-tools image

Routes:
  GET /api/health — health check

Build: ./hs stack build
Test:  ./hs stack test
Run:   ./scripts/run
2026-07-15 14:51:27 -04:00