256 Commits
Author SHA1 Message Date
admin a1f5f3126a Merge pull request 'chore(release): 2.0.0, merge roles into SSA' (#3) from chore/release-2.0.0 into main
Reviewed-on: #3
v2.0.0
2026-11-06 22:16:39 +08:00
adminandClaude Sonnet 5.5 2fed177fdc chore(release): 2.0.0, merge roles into SSA
Bump version to 2.0.0 (breaking: reporter, supervisor and capa_owner merged
into ssa, routes moved under /ssa). Add 2.0.0 release notes to docs/CHANGELOG.md.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 22:16:01 +08:00
admin e130b039d4 Merge pull request 'Chore/remove supabase legacy' (#2) from chore/remove-supabase-legacy into main
Reviewed-on: #2
2026-11-06 22:08:46 +08:00
adminandClaude Sonnet 5.5 1a2f9fbd47 docs(claude): drop removed Supabase leftovers, note ssa role
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 22:08:21 +08:00
adminandClaude Sonnet 5.5 2bda9d06a7 chore: remove legacy Supabase code and dependencies
The app no longer imports Supabase (migrated to local PostgreSQL 2026-09-30).
Remove lib/supabase/*, the supabase/ migrations folder, the @supabase/ssr and
@supabase/supabase-js dependencies, and the storage test for the removed client.
db/schema.sql and db/rls.sql remain the schema source of truth.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 22:07:21 +08:00
admin f32c6e8c60 Merge pull request 'Feat/ssa role' (#1) from feat/ssa-role into main
Reviewed-on: #1
2026-11-06 21:58:37 +08:00
adminandClaude Sonnet 5.5 4ec37bd078 test(layout): update app-shell search test for ssa role
ssa now has a site incident list, so its header search targets /ssa/incidents.
Use management for the no-search case.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 21:50:59 +08:00
Weei HanandClaude Sonnet 5.5 f52e63ad09 fix(db): make ssa role migration a single self-contained transaction
Drop and recreate auth_user_role() for the new user_role enum and re-apply all RLS policies inside the migration, so no separate db/rls.sql step is needed and there is no access gap.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 21:41:08 +08:00
Weei HanandClaude Sonnet 5.5 813395700f feat(auth): merge reporter, supervisor, capa_owner into ssa role
Add Site Safety Assistant (ssa) role replacing reporter, supervisor and
capa_owner. Portals move under /ssa (overview, my-reports, incidents,
capas). Update RLS, schema, API role checks, notification recipients,
nav and tests. Add db/ops/2026-11-06-merge-roles-into-ssa.sql (not yet
applied; needs owner go-ahead and a pg_dump first).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 21:34:10 +08:00
adminandClaude Sonnet 5.5 701fefd286 feat(report): show all trucks regardless of site
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 13:52:46 +08:00
adminandClaude Sonnet 5.5 f3c62d9225 Merge feat/truck-site: link trucks to a site, filter report truck list
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 12:01:16 +08:00
adminandClaude Sonnet 5.5 17c32ecd04 fix(trucks): skip active-site check when PATCH leaves site unchanged
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 11:53:32 +08:00
adminandClaude Sonnet 5.5 5f1d7a6ed4 feat(report): filter truck list by selected site
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 11:50:00 +08:00
adminandClaude Sonnet 5.5 149704898d feat(trucks): site select, site label and edit modal in admin
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 11:48:15 +08:00
adminandClaude Sonnet 5.5 f3f3aec59f feat(trucks): admin API accepts site_id and partial edits
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 11:46:31 +08:00
adminandClaude Sonnet 5.5 867b725262 feat(trucks): site_id column and site/truck helpers
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 11:44:37 +08:00
adminandClaude Sonnet 5.5 fd7a55337f docs: implementation plan for truck-to-site link
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 11:25:16 +08:00
adminandClaude Sonnet 5.5 2a9d32d1d0 docs: spec for linking trucks to a site
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 11:17:15 +08:00
adminandClaude Sonnet 5.5 c4377fb705 Merge feat/zone-capa-proof: zone picker, CAPA completion proof, test-data cleanup
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 11:07:32 +08:00
adminandClaude Sonnet 5.5 275a1ef3e9 docs(ops): cleanup must run as RLS-bypassing role, stop on error
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 11:18:20 +08:00
adminandClaude Sonnet 5.5 10f22b5cd5 chore(ops): test-data cleanup script and runbook
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 11:14:57 +08:00
adminandClaude Sonnet 5.5 1b84ed8625 fix(capa): handle network errors, keep form locked after submit, extend tests
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 11:13:53 +08:00
adminandClaude Sonnet 5.5 550a61cedc feat(capa): proof form for owners and photo gallery for HSE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 11:12:22 +08:00
adminandClaude Sonnet 5.5 de7fb298f7 fix(capa): atomic in_progress guard on submit, add behavioural tests
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 11:11:10 +08:00
adminandClaude Sonnet 5.5 51986b7ae5 feat(capa): require note and photos via /submit, block PATCH bypass
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 11:10:03 +08:00
adminandClaude Sonnet 5.5 cf5719883c feat(report): site and zone picker when no QR zone is detected
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 11:08:18 +08:00
adminandClaude Sonnet 5.5 98cc7c4ac9 docs: implementation plan for zone picker, CAPA proof, cleanup
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 11:05:57 +08:00
adminandClaude Sonnet 5.5 29bdb39506 docs: spec for zone picker, CAPA completion proof, test-data cleanup
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 11:02:12 +08:00
adminandClaude Haiku 4.5 99eca7d242 fix(ai): use correct llama.cpp model name
- Update model to qwen2.5-coder-32b-instruct-Q4_K_M
- Match actual model available in llama.cpp on port 8081

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-10-01 21:59:01 +08:00
adminandClaude Haiku 4.5 e89ecdd5c4 fix(ai): update endpoint to llama.cpp on port 8081
- Switch from Ollama (11434) to llama.cpp (8081)
- Point to OpenAI-compatible API at localhost:8081/v1

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-10-01 21:56:48 +08:00
adminandClaude Haiku 4.5 7424fe4f9b feat(ai): switch to qwen2.5-coder-8k model
- Use larger coder model (32.8B params) for better reasoning
- Update client default model
- Update all AI routes to use qwen2.5-coder-8k:latest
- Already installed and available on server Ollama

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-10-01 13:19:41 +08:00
adminandClaude Haiku 4.5 0ca92182ff feat(branding): add Setia logo favicon
- Crop Setia logo icon to 256x256 favicon
- Reference favicon in app metadata
- Displays in browser tabs and bookmarks

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-10-01 12:59:23 +08:00
adminandClaude Haiku 4.5 aac988010a fix: disable embeddings gracefully when GOOGLE_AI_API_KEY missing
- Catch and log GOOGLE_AI_API_KEY errors instead of failing
- Allows endpoints to work without embeddings configured

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-10-01 12:03:07 +08:00
adminandClaude Haiku 4.5 4f9ca6e37f docs(design): record slice 2 (CAPA) and the mockup features that need a backend
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-10-01 11:37:41 +08:00
adminandClaude Haiku 4.5 48b77458dd test(capa): fix the fetch mock typing in the create form test
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-10-01 11:37:11 +08:00
adminandClaude Haiku 4.5 7e129b2781 feat(capa): restyle the create CAPA form and page with the shared field primitives
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-10-01 11:35:46 +08:00
adminandClaude Haiku 4.5 4f75dd5887 feat(ai): switch from DeepSeek to local Ollama (qwen3:14b)
- Point AI client to localhost:11434/v1 (Ollama)
- Remove DeepSeek API key dependency
- Update model name to qwen3:14b across all routes
- Update test mocks to use createLocalLLMClient
- Removes need for DEEPSEEK_API_KEY setting

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-10-01 11:34:05 +08:00
adminandClaude Haiku 4.5 69e510af74 feat(capa): restyle the CAPA detail page, verification form, close card, owner actions and notes
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-10-01 11:20:57 +08:00
adminandClaude Haiku 4.5 04437926c2 feat(capa): replace the CAPA board with a workspace (TableCard list and status board) with search, filters and saved views
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-10-01 10:47:04 +08:00
adminandClaude Haiku 4.5 9dca2a51d2 feat(capa): add pure list helpers for filtering, saved views, sorting and paging
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-10-01 10:26:34 +08:00
adminandClaude Haiku 4.5 9f0331d190 docs: add IMS Admin refresh slice 2 (CAPA) implementation plan
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-10-01 10:20:01 +08:00
adminandClaude Haiku 4.5 87f553321b fix(design): correct the incident list footer range on empty and out-of-range pages
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-10-01 09:43:44 +08:00
adminandClaude Haiku 4.5 582504c24b feat(design): colour banners and badges by meaning, document slice 1 and update design notes
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-10-01 09:36:01 +08:00
adminandClaude Haiku 4.5 a64b951922 feat(design): migrate the Incidents list to TableCard with server-side views, sort, filters and paging
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-10-01 09:33:44 +08:00
adminandClaude Haiku 4.5 9ba708ecb7 feat(design): add AppShell, MobileShell and the notifications drawer
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-10-01 09:31:12 +08:00
adminandClaude Haiku 4.5 32dd42ac79 feat(design): add TableCard (views, toolbar, sortable header, selection, bulk bar, footer pager, empty, mobile list)
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-10-01 09:29:35 +08:00
adminandClaude Haiku 4.5 2a5b9332c7 feat(design): add IMS Admin primitives (Button, StatusTag, Checkbox, FilterChip, Segmented, Avatar, Drawer) and restyle Field, Card, Modal
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-10-01 09:28:34 +08:00
adminandClaude Haiku 4.5 01343d732e feat(design): switch to IMS Admin tokens, Geist and the 1px-rule gate
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-10-01 09:26:08 +08:00
adminandClaude Haiku 4.5 9ed8c97c24 docs: add IMS Admin refresh slice 1 implementation plan
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-10-01 09:21:28 +08:00
adminandClaude Haiku 4.5 f117605775 docs(design): add design.md for the IMS Admin refresh and track its mockup references
Derived from IMS Admin Spec.dc.html and IMS Admin.dc.html. Defines tokens,
components (StatusTag, TableCard, shells, drawer), screen index, build order
and the changes from the live Modernist build. CLAUDE.md already cites it as
the source of truth.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-10-01 08:37:36 +08:00