Commit Graph

194 Commits

Author SHA1 Message Date
a49680b274 Merge pull request 'main' (#58) from main into production
Reviewed-on: #58
2026-02-10 00:45:44 +00:00
701a5c21ce Merge pull request 'fix(sse): disable read deadline for long-lived connections' (#56) from fix-sse-read-deadline into main
Reviewed-on: #56
2026-02-09 17:39:09 +00:00
Forbes
f7aa673d2c fix(sse): disable read deadline for long-lived SSE connections
The server's ReadTimeout (15s) was closing SSE connections shortly after
they were established, causing a rapid connect/disconnect loop. The handler
already disabled WriteTimeout but not ReadTimeout.
2026-02-08 22:52:42 -06:00
2157b40d06 Merge pull request 'feat(web): BOM merge resolution UI (#47)' (#55) from issue-47-bom-merge-ui into main
Reviewed-on: #55
2026-02-09 02:09:02 +00:00
Forbes
25c42bd70b feat(web): add BOM merge resolution UI with source badges and dropdown
- Add source badges (assembly=teal, manual=blue) to BOM display rows
- Add info banner when assembly-sourced entries exist
- Change source input from text field to select dropdown
- Add merge response types to types.ts

Closes #47
2026-02-08 19:56:33 -06:00
8d88f77ff6 Merge pull request 'feat: expose file attachment stats as item properties' (#54) from issue-37-file-stats into main
Reviewed-on: #54
2026-02-09 01:26:17 +00:00
Forbes
50985ed805 feat: expose file attachment stats as item properties (#37)
Add file_count and files_total_size to item API responses, computed
via batch query on item_files table (no migration needed).

- Add BatchGetFileStats() to audit_queries.go (follows BatchCheckBOM pattern)
- Add file stats to ItemResponse, HandleListItems, HandleGetItem, HandleGetItemByUUID
- Add 'Files' column to ItemTable (default visible in vertical mode)
- Add has_files computed field to audit completeness scoring (weight 1 for manufactured)
2026-02-08 19:25:46 -06:00
32bc00caef Merge pull request 'main' (#53) from main into production
Reviewed-on: #53
2026-02-09 01:23:28 +00:00
9be6f45f09 Merge pull request 'chore(docs): delete stale documentation files' (#52) from issue-31-delete-dead-docs into main
Reviewed-on: #52
2026-02-09 01:22:02 +00:00
ef05aec619 Merge branch 'main' into issue-31-delete-dead-docs 2026-02-09 01:21:52 +00:00
64075d88b5 Merge pull request 'feat(api): add POST /api/items/{partNumber}/bom/merge endpoint' (#51) from issue-45-bom-merge into main
Reviewed-on: #51
2026-02-09 01:21:44 +00:00
eac64f863b Merge branch 'main' into issue-45-bom-merge 2026-02-09 01:21:38 +00:00
aa414adc43 Merge pull request 'feat(db): add source column to relationships table' (#50) from issue-44-bom-source into main
Reviewed-on: #50
2026-02-09 01:21:30 +00:00
9ce9468474 Merge branch 'main' into issue-44-bom-source 2026-02-09 01:21:13 +00:00
2dad658e91 Merge pull request 'feat(api): add GET /api/items/by-uuid/{uuid} endpoint' (#49) from issue-43-uuid-lookup into main
Reviewed-on: #49
2026-02-09 01:21:07 +00:00
ce37fdd169 Merge branch 'main' into issue-43-uuid-lookup 2026-02-09 01:20:59 +00:00
c557ca736c Merge pull request 'feat(web): user-selectable density mode (compact/comfortable)' (#48) from ui-density-mode into main
Reviewed-on: #48
2026-02-09 01:20:51 +00:00
6805a3c662 Merge branch 'main' into ui-density-mode 2026-02-09 01:20:44 +00:00
4324214b4d Merge pull request 'chore: repo cleanup — stale docs, redundant files, config update' (#42) from cleanup-repo-hygiene into main
Reviewed-on: #42
2026-02-09 01:20:35 +00:00
98aac5e0be Merge branch 'main' into cleanup-repo-hygiene 2026-02-09 01:20:26 +00:00
Forbes
08e84703d5 chore(docs): delete stale REPOSITORY_STATUS.md (#31)
Generated 2026-01-31, references HTML templates and 8 migrations
that are now outdated. Superseded by STATUS.md and SPECIFICATION.md.

API.md and silo-spec.md were already deleted in earlier commits.
2026-02-08 19:17:53 -06:00
Forbes
fbe4f3a36c feat(api): add POST /api/items/{partNumber}/bom/merge endpoint (#45)
Add BOM merge endpoint for syncing assembly-derived BOM entries from
FreeCAD's silo-mod plugin.

Merge rules:
- Added: entries in request but not in server BOM are auto-created
  with source='assembly'
- Quantity changed: existing entries with different quantity are
  auto-updated
- Unchanged: same part and quantity are skipped
- Unreferenced: assembly-sourced entries in server BOM but not in
  request are flagged as warnings (never auto-deleted)
- Manual entries are silently ignored in unreferenced detection

Also emits SSE 'bom.merged' event on successful merge (#46).
2026-02-08 19:15:27 -06:00
Forbes
163dc9f0f0 feat(db): add source column to relationships table (#44)
Promote BOM source from metadata JSONB to a dedicated VARCHAR(20)
column with CHECK constraint ('manual' or 'assembly').

- Add migration 012_bom_source.sql (column, data migration, cleanup)
- Add Source field to Relationship and BOMEntry structs
- Update all SQL queries (GetBOM, GetWhereUsed, GetExpandedBOM, Create)
- Update API response/request types with source field
- Update CSV/ODS export to read e.Source instead of metadata
- Update CSV import to set source on relationship directly
- Update frontend types and BOMTab to use top-level source field
2026-02-08 18:45:41 -06:00
Forbes
e5ddb30a4a feat(api): add GET /api/items/by-uuid/{uuid} endpoint
Closes #43

Adds a new read-only endpoint to resolve a Silo item UUID to its full
ItemResponse. Used by silo-mod to resolve FreeCAD document SiloUUID
properties to part numbers during BOM sync.

- Reuses existing ItemRepository.GetByID() (items.id is the stable UUID)
- Returns 404 for archived items
- Registered in viewer-accessible route group (no editor role required)
2026-02-08 18:37:33 -06:00
Forbes
cb88b3977c feat(web): add user-selectable density mode with compact/comfortable toggle
Implements #17, #18, #19, #20, #21

- Add CSS custom properties for density-dependent spacing (--d-* vars)
  in theme.css with comfortable (default) and compact modes
- Create useDensity hook with localStorage persistence and DOM attribute sync
- Add FOUC prevention in main.tsx (sync density before first paint)
- Create shared PageFooter component merging stats + pagination
- Refactor AppShell to flex layout with density toggle button (COM/CMP)
- Consolidate inline pagination from ItemsPage/AuditPage into PageFooter
- Delete FooterStats.tsx (replaced by PageFooter)
- Replace all hardcoded padding/font/gap values in ItemTable, AuditTable,
  ItemsToolbar, and AuditToolbar with var(--d-*) references

Comfortable mode is already tighter than the previous hardcoded values.
Compact mode reduces further for power-user density.
2026-02-08 18:35:25 -06:00
Forbes
de8370481f chore: fix stale docs, add read_only to config example
- Update COMPONENT_AUDIT.md: replace htmx reference with React SPA
- Add server.read_only to config.example.yaml and CONFIGURATION.md
2026-02-08 16:07:05 -06:00
Forbes
fbe80d6a2f chore: delete stale REPOSITORY_STATUS.md
Generated Jan 31, references HTML templates and 8 migrations.
Superseded by STATUS.md, SPECIFICATION.md, and frontend-spec.md.
2026-02-08 16:03:55 -06:00
2b7a9ae73a Merge pull request 'main' (#41) from main into production
Reviewed-on: #41
2026-02-08 22:02:18 +00:00
80b334f308 Merge branch 'production' into main 2026-02-08 22:02:12 +00:00
741df1a1ba Merge pull request 'feat: SSE endpoint and server mode system (#38, #39)' (#40) from feat-38-39-sse-server-mode into main
Reviewed-on: #40
2026-02-08 22:00:11 +00:00
98e9898ae9 Merge branch 'main' into feat-38-39-sse-server-mode 2026-02-08 22:00:01 +00:00
Forbes
3d7302f383 feat: add SSE endpoint and server mode system
Add server-sent events at GET /api/events for live mutation
notifications. Add server mode (normal/read-only/degraded) exposed
via /health, /ready, and SSE server.state events.

New files:
- broker.go: SSE event hub with client management, non-blocking
  fan-out, ring buffer history for Last-Event-ID replay, heartbeat
- servermode.go: mode state machine with periodic MinIO health
  check and SIGUSR1 read-only toggle
- sse_handler.go: HTTP handler using http.Flusher and
  ResponseController to disable WriteTimeout for long-lived SSE
- broker_test.go, servermode_test.go: 13 unit tests

Modified:
- handlers.go: Server struct gains broker/serverState fields,
  Health/Ready include mode and sse_clients, write handlers
  emit item.created/updated/deleted and revision.created events
- routes.go: register GET /api/events, add RequireWritable
  middleware to all 8 editor-gated route groups
- middleware.go: RequireWritable returns 503 in read-only mode
- csv.go, ods.go: emit bulk item.created events after import
- storage.go: add Ping() method for health checks
- config.go: add ReadOnly field to ServerConfig
- main.go: create broker/state, start background goroutines,
  SIGUSR1 handler, graceful shutdown sequence

Closes #38, closes #39
2026-02-08 15:59:23 -06:00
9a25c72b11 Merge pull request 'main' (#36) from main into production
Reviewed-on: #36
2026-02-08 21:25:02 +00:00
2d45042cdb Merge branch 'production' into main 2026-02-08 21:24:56 +00:00
c4572af1f0 Merge pull request 'docs: update README.md for React SPA and current state' (#35) from issue-25-readme-update into main
Reviewed-on: #35
2026-02-08 21:24:00 +00:00
15e71d936e Merge pull request 'fix: render project tags as strings, not objects' (#34) from fix-33-project-tags-render into main
Reviewed-on: #34
2026-02-08 21:23:19 +00:00
Forbes
c49f8f78c9 fix: render project tags as strings, not objects
The /api/items/{pn}/projects endpoint returns Project objects
({id, code, name, created_at}), but MainTab typed them as string[].
React error #31 was thrown when trying to render the object as a
child node.

Change itemProjects state from string[] to Project[] and use
proj.code in all rendering and comparison logic.

Closes #33
2026-02-08 15:11:20 -06:00
21227b7586 Merge pull request 'docs: update all documentation for React SPA migration' (#32) from issue-26-31-doc-updates into main
Reviewed-on: #32
2026-02-08 20:13:36 +00:00
Forbes
e3da072229 docs: update SPECIFICATION.md for React SPA and current endpoints
- Replace htmx with React SPA in architecture diagram and tech stack
- Rewrite Section 6 (Web Interface) with React SPA architecture,
  pages table, and design patterns
- Update Section 11.1: remove old web UI routes, add /api/auth/config,
  /api/uploads/presign, file attachment endpoints, thumbnail endpoint
- Fix endpoint count: 76 → 75 (actual registered routes)
- Fix migration count: 10 → 11
- Add file attachments to MVP checklist
- Update test coverage note (9 test files exist)

Closes #26
2026-02-08 14:11:12 -06:00
Forbes
eb43fbb9ec docs: update frontend-spec.md for completed migration
- Mark Phase 4 (remove Go templates) as complete
- Update architecture: SPA serves at / via NotFound handler
- Update overview to past tense (migration is done)
- Update file/line counts (~40 files, ~7,600 lines)
- Mark backend changes 1-3 and 5 as implemented
- Reorganize remaining work section

Closes #30
2026-02-08 14:07:38 -06:00
Forbes
5fd499fef3 docs: update GAP_ANALYSIS.md for current state
- Remove silo-spec.md from doc table (deleted)
- Add CONFIGURATION.md, AUTH.md, AUTH_USER_GUIDE.md, frontend-spec.md to doc table
- Mark Configuration Reference as complete
- Fix audit_handlers.go filename (was handlers_audit.go)
- Update Appendix A file structure to match actual codebase
- Fix future migration numbering (012/013, since 011 is taken)
- Add file attachment endpoints to Appendix B
- Remove completed Documentation Overhaul from medium-term

Closes #28
2026-02-08 14:06:18 -06:00
Forbes
adf64d722c docs: update ROADMAP.md for React SPA and current counts
- Replace all htmx references with React SPA
- Update endpoint count from 74 to 75 (6 occurrences)
- Update migration count from 10 to 11
- Update test file count from 1 to 9
- Fix comparison matrix web access entry

Closes #29
2026-02-08 14:05:08 -06:00
Forbes
124eac1391 docs: update STATUS.md for current state
- Update migration count to 11, add 011_item_files.sql
- Update endpoint count from 74 to 75
- Replace htmx reference with React SPA
- Add file attachments as complete feature
- Update test file count from 1 to 9
- Update date to 2026-02-08

Closes #27
2026-02-08 14:04:26 -06:00
Forbes
e61df2db04 docs: update README.md for React SPA and current state
- Replace htmx reference with React SPA (Vite + TypeScript, Catppuccin Mocha)
- Update component tree: add web/ subtree, testutil package, remove templates
- Correct endpoint count (75) and migration count (11)
- Expand documentation table from 6 to 10 entries (add CONFIGURATION.md,
  GAP_ANALYSIS.md, COMPONENT_AUDIT.md, frontend-spec.md)

Closes #25
2026-02-08 14:00:50 -06:00
d504de84a7 Merge pull request 'feat: production React SPA, file attachments, and UI improvements' (#24) from issue-16-remove-max-width into main
Reviewed-on: #24
2026-02-08 19:47:00 +00:00
Forbes
1b73a1e070 docs: add workflow integration mention to overview 2026-02-08 13:45:48 -06:00
d3b8fca660 Merge pull request 'main' (#23) from main into production
Reviewed-on: #23
2026-02-07 21:01:36 +00:00
11a3944270 Merge pull request 'issue-16-remove-max-width' (#22) from issue-16-remove-max-width into main
Reviewed-on: #22
2026-02-07 21:00:47 +00:00
Forbes
888cebe875 feat(web): remove max-width constraint and reduce main padding
Remove maxWidth: 1400 and margin: 0 auto from AppShell main container.
Reduce padding from 2rem to 1rem so content fills available browser width.
Adjust height calc in ItemsPage and AuditPage from 80px to 64px offset
to account for reduced top padding.

Closes #16
2026-02-07 14:51:55 -06:00
Forbes
50923cf56d feat: production release with React SPA, file attachments, and deploy tooling
Backend:
- Add file_handlers.go: presigned upload/download for item attachments
- Add item_files.go: item file and thumbnail DB operations
- Add migration 011: item_files table and thumbnail_key column
- Update items/projects/relationships DB with extended field support
- Update routes: React SPA serving from web/dist, file upload endpoints
- Update auth handlers and middleware for cookie + bearer token auth
- Remove Go HTML templates (replaced by React SPA)
- Update storage client for presigned URL generation

Frontend:
- Add TagInput component for tag/keyword entry
- Add SVG assets for Silo branding and UI icons
- Update API client and types for file uploads, auth, extended fields
- Update AuthContext for session-based auth flow
- Update LoginPage, ProjectsPage, SchemasPage, SettingsPage
- Fix tsconfig.node.json

Deployment:
- Update config.prod.yaml: single-binary SPA layout at /opt/silo
- Update silod.service: ReadOnlyPaths for /opt/silo
- Add scripts/deploy.sh: build, package, ship, migrate, start
- Update docker-compose.yaml and Dockerfile
- Add frontend-spec.md design document
2026-02-07 13:35:22 -06:00