Commit graph

7 commits

Author SHA1 Message Date
aef912f9a4 fix(client): bridge same-origin proxy via Vite + dev token fallback — Patch 021
Cross-origin (5173 vs 4000) blocked the auth cookie from reaching the
bridge — every /database slash command request 401'd silently. Two
changes:

1. vite.config.ts: add /bridge -> http://localhost:4000 proxy with
   path rewrite + /bridge-events -> /api/events for SSE. Same-origin =
   browser sends the auth cookie automatically.
2. bridge-client.ts: resolveBridgeUrl() defaults to /bridge instead
   of absolute http://localhost:4000. Also adds a VITE_BRIDGE_TOKEN env
   fallback for dev (the bridge requires Bearer auth and the Docmost
   session cookie is HttpOnly so JS cannot read it).

Patch 021.
2026-05-08 12:32:33 +02:00
d0b75774d8 feat(acadenice): add timeline view (Gantt) for databases — R4.1
- New TimelineRenderer using @fullcalendar/timeline + @fullcalendar/resource-timeline
- Column mapping config (title/start/end/resource) persisted in bridge Redis TTL 30d
- useTimelineConfig hook (GET+POST /views/:viewId/timeline-config)
- Inline config panel shown on first use; re-accessible via Configure button
- Resource swimlane mode activated automatically when resourceCol is configured
- eventResize persists endCol via useUpdateRow (respects canWriteRows)
- End date fallback: start + 1 day when endCol is absent
- InsertDatabaseModal extended with step 3 for column mapping on timeline views
- database-view-component dispatches timeline viewType to TimelineRenderer
- 14 client Vitest tests + 12 bridge Vitest tests (26 total new, all green)
- 0 TypeScript errors (client + bridge)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 11:27:11 +02:00
4cf04080cf fix(acadenice): resolve test suite failures across R3 sub-blocks (Patch 017)
- Convert 17 server spec files from vitest to Jest (vi -> jest globals)
- Add jest.mock stubs for ESM-only prosemirror/html and collaboration modules
- Fix Zod v4 strict UUID validation failures in test fixtures (version byte [1-8] required)
- Add JwtAuthGuard.overrideGuard in all controller specs that lacked it
- Fix jest.Mock type inference (ReturnType<typeof jest.fn> -> jest.Mock) to prevent 'never' arg errors
- Delete vitest.config.ts (CJS), keep vitest.config.mts (ESM-compatible) on client
- Add global mocks for @excalidraw/excalidraw and @/main.tsx in client test-setup
- Result: client 38/38 suites 313/313 tests, server acadenice 21/21 suites 210/210 tests, 0 TS errors

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 10:36:19 +02:00
be951a22ac feat(acadenice): add inline comments threads for R3.8 (30 tests, Patch 016)
Page comments: REST resolve/unresolve facade over native comments table
(PageCommentResolveService + CollaborationGateway yjs mark sync).
Row comments: new acadenice_row_comment table + full CRUD + resolve
(RowCommentService, RowCommentsController) + React panel in RowDetailModal.
4 new permissions: comments:read/write/resolve/moderate (30 total).
i18n FR+EN. R3 ENTIEREMENT TERMINE.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 02:47:15 +02:00
ba8d8678a0 test(e2e): add data-testid attributes for Playwright e2e (Patch 008 R3.1.e)
Minimal testid additions to 4 renderer files so Playwright can target
stable selectors: table-renderer, cell-{rowId}-{fieldName}, kanban-board,
kanban-column-{label}, kanban-card-{rowId}, calendar-renderer,
inline-editor-input, inline-editor-readonly.

Also adds Dockerfile.e2e for the client build used in docker-compose.e2e.yml.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 00:37:39 +02:00
f3fae2ac78 feat(client): add kanban + calendar renderers + inline edit for R3.1.d
- KanbanRenderer: @dnd-kit drag-drop, group by single_select field,
  optimistic update + rollback, empty column placeholder, read-only mode
- CalendarRenderer: @fullcalendar month/week/day toggle, eventDrop ->
  PATCH date field, event click -> RowDetailModal, stub deps noted
- InlineEditor: polymorphic (text/number/date/select/multi-select),
  save on blur/Enter, cancel on Escape, permission denied read-only
- RowDetailModal: simple field detail view opened from calendar events
- useUpdateRow: generic PATCH with React Query v5 optimistic+rollback
- usePermissions: reads acadenice_permissions from window global or cookie
- patchRow helper added to bridge-client.ts
- DatabaseViewComponent: dispatches kanban/calendar to real renderers
- TableRenderer: integrates InlineEditor on double-click cells
- i18n: +12 keys (kanban.*, calendar.*, edit.*, row_detail.*) in en-US + fr-FR
- 5 new test suites: kanban, calendar, inline-editor, use-update-row, use-permissions
- Updated database-view-component.test.tsx for R3.1.d dispatch

Deps to install: @dnd-kit/core@^6 @dnd-kit/sortable@^8 @dnd-kit/utilities@^3
  @fullcalendar/react@^6 @fullcalendar/daygrid@^6
  @fullcalendar/timegrid@^6 @fullcalendar/interaction@^6

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 00:24:12 +02:00
71c2abad8a feat(client): add database-view Tiptap extension for R3.1.c
- Tiptap Node extension (database-view) with attrs tableId/viewId/viewType/bridgeUrl
- NodeViewWrapper dispatches on viewType: grid/table -> TableRenderer, other -> PlaceholderRenderer
- TableRenderer (HTML table, TanStack Table v8 migration-ready - dep not yet installed)
- InsertDatabaseModal (Mantine, 2-step: table -> view selection)
- useDatabaseRealtimeUpdates SSE hook (EventSource + exponential backoff + React Query invalidation)
- bridge-client.ts (axios wrapper, per-origin singleton, cookie Bearer passthrough)
- Slash command /database registered in menu-items CommandGroups
- DatabaseViewExtension wired in mainExtensions array
- i18n: 22 keys added in en-US and fr-FR
- 41 Vitest tests across 5 suites (extension schema, component dispatch, renderer states, modal steps, SSE hook)

Upstream patches: extensions.ts (+2 lines), menu-items.ts (+4 lines), 2 translation files

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 00:07:33 +02:00