Commit Graph

98 Commits

Author SHA1 Message Date
a258152175 Merge pull request 'docs: update specs for schema-driven form descriptor API' (#60) from issue-docs-form-descriptor into main
Reviewed-on: #60
2026-02-11 16:41:16 +00:00
efb3ccdfb5 Merge branch 'main' into issue-docs-form-descriptor 2026-02-11 16:41:07 +00:00
a80e99e500 docs: update specs for schema-driven form descriptor API
- frontend-spec.md: rewrite CreateItemPane spec for dynamic form
  rendering from form descriptor, replace CategoryPicker three-column
  spec with multi-stage domain/subcategory picker, replace useCategories
  hook with useFormDescriptor, update form sections to dynamic field
  groups, mark hierarchical categories as implemented, remove
  sourcing_link/standard_cost from item-level DB columns, update types
  and implementation order
- SPECIFICATION.md: rename /api/schemas/{name}/properties endpoint to
  /api/schemas/{name}/form
2026-02-11 10:40:09 -06:00
485675b020 Merge pull request 'issue-dedup-sourcing-cost' (#59) from issue-dedup-sourcing-cost into main
Reviewed-on: #59
2026-02-11 16:28:50 +00:00
beaf091d62 Merge branch 'main' into issue-dedup-sourcing-cost 2026-02-11 16:28:42 +00:00
4edaa35c49 feat: schema-driven form descriptor API and dynamic form rendering
- Add ui section to kindred-rd.yaml with category_picker (multi-stage),
  item_fields, field_groups, category_field_groups, and field_overrides
- Add UIConfig structs to Go schema parser with full YAML/JSON tags
- Add ValidateUI() to validate field references against property schemas
- Add ValuesByDomain() helper to auto-derive subcategory picker stages
- Implement GET /api/schemas/{name}/form endpoint that returns resolved
  form descriptor with field metadata, widget hints, and category picker
- Replace GET /api/schemas/{name}/properties route with /form
- Add FormDescriptor TypeScript types
- Create useFormDescriptor hook (replaces useCategories)
- Rewrite CreateItemPane to render all sections dynamically from descriptor
- Update CategoryPicker with multi-stage domain/subcategory selection
- Delete useCategories.ts (superseded by useFormDescriptor)
2026-02-11 10:14:00 -06:00
b3c748ef10 refactor: move sourcing_link and standard_cost from item columns to revision properties
- Add migration 013 to copy sourcing_link/standard_cost values into
  current revision properties JSONB and drop the columns from items table
- Remove SourcingLink/StandardCost from Go Item struct and all DB queries
  (items.go, audit_queries.go, projects.go)
- Remove from API request/response structs and handlers
- Update CSV/ODS/BOM export/import to read these from revision properties
- Update audit handlers to score as regular property fields
- Remove from frontend Item type and hardcoded form fields
- MainTab now reads sourcing_link/standard_cost from item.properties
- CreateItemPane/EditItemPane no longer have dedicated fields for these;
  they will be rendered as schema-driven property fields
2026-02-11 09:50:31 -06: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
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
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