Commit graph

32 commits

Author SHA1 Message Date
Will Chen
2ec89a7c52
Merge pull request #230 from amal66/olp-pr/frontend-unit-tests
Some checks failed
CI / Backend build and tests (push) Has been cancelled
CI / Frontend build and tests (push) Has been cancelled
CI / Eval harness (push) Has been cancelled
[Testing 07] test: component and hook unit tests for the web app
2026-07-22 16:59:39 +08:00
Will Chen
7d2ba4b87f
Merge pull request #235 from amal66/olp-pr/lint-burndown
[Lint 04] fix: burn down frontend eslint errors; make CI lint blocking
2026-07-22 16:33:52 +08:00
Will Chen
eda088e143
Merge pull request #238 from amal66/olp-pr/directory-fetch-storm
[Fix 01] Batch the directory modal's project fetch (N+1 getProject storm)
2026-07-21 16:51:36 +08:00
QA Runner
36cddb2566 fix: batch directory-modal project fetch instead of N+1 getProject burst
Every directory picker (AddDocumentsModal, UseWorkflowModal, the assistant
project selector) loads its "Projects" tab through useDirectoryData, which
fired one GET /projects/:id for EVERY existing project the moment the modal
opened. Each of those requests costs an auth verification against GoTrue
plus ~6 PostgREST queries, so an account with N projects produced an
~8xN-request burst on the Supabase gateway per modal open.

Under that burst the gateway genuinely falls over: measured locally against
the Supabase CLI stack, overlapping modal-open storms drove GoTrue into
Postgres connection exhaustion ("failed to connect ... context deadline
exceeded") and produced 467x 500 + 641x 504 on /auth/v1/user in a single
run — surfacing to users as failed project creates/loads, and to the e2e
suite as the intermittent Kong 502s its specs currently retry around.

Fix: GET /projects now accepts ?include=documents and returns each
project's documents from one batched query (same attach helpers as
GET /projects/:id, run once across all documents), and useDirectoryData
uses it. A modal open is now 1 API request and a fixed number of DB
queries regardless of project count. After the change the same storm
harness produced zero 5xx and zero auth failures.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-20 22:05:48 -07:00
QA Runner
0740f656e6 fix: burn down frontend eslint errors; make CI lint blocking
Takes frontend/npm run lint from 23 errors / 40 warnings to 0 errors /
40 warnings, then removes continue-on-error from the CI lint step so it
gates merges.

Errors fixed outright:
- @typescript-eslint/no-explicit-any (5, ChatView.tsx): dropped
  redundant (msg as any) casts — Message already declares files,
  workflow, and error with the exact shapes the props expect.
- react/no-unescaped-entities (1, support/page.tsx): "We'll" ->
  "We&apos;ll".

Targeted disables (17, all react-hooks/set-state-in-effect): every site
is an intentional effect-driven state pattern — SSR/hydration mount
gates (Modal, useSelectedModel), reset-on-prop/identity-change
(CaseLawPanel x3, ChatView chat switch, CitationQuotesHeader,
ChatHistoryContext logout, useFetchDocxBytes), sync fast paths of async
fetch/check effects (CaseLawPanel, MfaLoginGate x2), DOM-measured state
(ChatView scroll button, message-visibility restore), and timed UI
latches (PreResponseWrapper, TRChatPanel, AskInputPopup auto-submit).
Rewriting any of them would change runtime behavior, so each carries a
// eslint-disable-next-line with a one-line reason instead of a fix or
a repo-wide rule change.

CI: lint step is now blocking; comments updated to say the backlog is
at zero.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-20 11:17:24 -07:00
QA Runner
a29e67deac test: component and hook unit tests for the web app
Ported from the amal66 fork (index: Open-Legal-Products/mike#205), adapted
to this repo's frontend/ layout and current component behavior. Adds the
jsdom + testing-library harness on top of the existing vitest setup:
vitest.config.mts (jsdom environment, @/ alias mirroring tsconfig paths,
dummy Supabase env for modules that build a client at import time) and
vitest.setup.ts (jest-dom matchers). New devDependencies: jsdom,
@testing-library/react, @testing-library/jest-dom,
@testing-library/user-event, @vitejs/plugin-react.

Ported suites (30 new tests):
- FileTypeIcon.test.tsx (11) — fileTypeKind mapping + icon rendering
- TRTable.test.tsx (1) — header/row render smoke test; the fork's ARIA
  role assertions (table/columnheader, "Tabular review" label) target
  fork-only markup — this repo's grid is div-based, so the test asserts
  rendered content instead
- button.test.tsx (4), pill-button.test.tsx (8), cite-button.test.tsx (3)
- useSmoothedReveal.test.ts (3) — passes against this repo's early-return
  snap behavior unchanged

Dropped (subjects don't exist here):
- HistoryDropdown.test.tsx — no tr-chat-panel/HistoryDropdown component
- applyAssistantStreamEvent.test.ts — no such module
- useProjectsQuery/useTabularReviewsQuery/useWorkflowsQuery tests —
  react-query is fork-only
- lib/toast.test.ts — no frontend/src/lib/toast.ts
- useAssistantChat.parsers.test.ts — the parser helpers exist inside
  useAssistantChat.ts but are not exported, and the fork's extracted
  module doesn't exist here

Verified: frontend npm test 38/38 passing (30 new + 8 pre-existing cn()
utils tests); npx tsc --noEmit clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-20 10:50:11 -07:00
QA Runner
4039b94980 test: minimal vitest harness for backend and frontend
Ported from amal66/mike#24 onto current main; lockfiles regenerated against
this tree. Adds vitest as a dev dependency with a `test` script in both
packages, excludes test files from the backend tsc build, and seeds one
suite per package (backend: downloadTokens, 12 tests; frontend: cn() utils,
8 tests). Verified locally: backend 12/12, frontend 8/8 passing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-20 10:42:28 -07:00
willchen96
fa21ac8fd7 feat: refresh workflows and workflow editor UI 2026-07-20 03:04:47 +08:00
willchen96
f5abbac42c feat: refine liquid surfaces and document review panels 2026-07-17 01:22:12 +08:00
willchen96
f0b90ab3b4 feat: add library and refresh shared table UI 2026-07-16 20:07:12 +08:00
willchen96
82dcaefc43 feat: workflow, UI and document support updates 2026-07-08 18:27:28 +08:00
willchen96
a5fe6d6e04 Sync workflow, asst extra input, excel + ppt support and modal updates 2026-07-04 23:24:31 +08:00
willchen96
9a1277ba99 refactor: add table primitive and migrations by date; feat: add mcp connectors 2026-06-15 17:34:58 +08:00
willchen96
3132e04ac0 Modal, header, mobile display and workflow UI updates 2026-06-11 22:43:13 +08:00
willchen96
1fa0554ea5 Refactor ProjectPageParts and ProjectPageHeader components for improved loading states and skeleton UI. Update Modal and PageHeader components to support loading states. Enhance RenameableTitle for better caret positioning. Adjust DisplayWorkflowModal to utilize the new Modal component structure. Update WorkflowList to include loading indicators and improve sticky header behavior. 2026-06-11 21:50:58 +08:00
willchen96
444d1d38e4 feat: enhance user profile management and MFA login flow
- Refactor user profile loading and updating logic to improve state management and reduce unnecessary checks.
- Update MFA login gate to streamline verification checks and improve user experience.
- Ensure consistent handling of user ID across profile context and components.
- Improve error handling and loading states in user-related API calls.
2026-06-10 18:55:33 +08:00
willchen96
3a10943200 feat: implement multi-factor authentication (MFA) setup and verification flow
- Add SecurityPage component for managing MFA settings, including enrollment and verification.
- Create MfaLoginGate to handle MFA verification state during login.
- Develop MfaVerificationPopup for user input of verification codes.
- Implement VerifyMfaPage for the MFA verification process after login.
- Introduce reusable VerificationCodeInput component for entering verification codes.
- Integrate Supabase MFA API for managing factors and verification.
- Add loading states and error handling for a better user experience.
2026-06-10 03:48:08 +08:00
willchen96
f32a194b33 Sync CourtListener verification and document safety updates
- Refine CourtListener citation verification, bulk lookup logging, and API fallback behavior
- Persist cancelled chat stream output and render cancellation as the final assistant message
- Add document/version deletion safety fixes and shared warning/modal UI updates
- Sync document panel, case law panel, and response UI styling refinements
- Harden OSS sync script to preserve local env, dependency, and generated files
2026-06-09 01:46:58 +08:00
willchen96
44e868eb42 Add courtlistener intergration, liquid glass redesign, UI improvements, version control, various fixes 2026-06-06 15:48:47 +08:00
willchen96
4f3384334a Update document UI, tabular reviews, and storage caching 2026-05-18 00:21:40 +08:00
willchen96
9749d601fa fix: enforce SUPABASE_URL and SUPABASE_SECRET_KEY presence in server-side client; remove unused supabase-server.ts file 2026-05-16 01:16:05 +08:00
willchen96
87e55d6046 feat: prevent users from sharing projects and reviews with themselves 2026-05-16 00:05:16 +08:00
willchen96
08d996781a feat: enhance workflow sharing by preventing users from sharing with themselves and normalizing email inputs 2026-05-14 23:29:08 +08:00
willchen96
f39f175273 Sync deployment and project page fixes 2026-05-13 02:32:26 +08:00
willchen96
91d0c2a089 chore: update Next and Cloudflare dependencies 2026-05-12 13:40:01 +08:00
willchen96
af5691e773 Update OSS setup docs and remove app legal pages 2026-05-11 03:15:34 +08:00
willchen96
a84c1cc113 docs: improve setup guidance and env examples 2026-05-10 22:36:29 +08:00
willchen96
bef75b082d feat: add OpenAI model support and harden OSS security defaults 2026-05-09 14:55:51 +08:00
cosimoastrada
1f191fea59
Merge branch 'main' into codex/safe-local-testing-guide 2026-05-08 23:05:03 +08:00
willchen96
ba6f771144 Sync security and backend profile updates 2026-05-08 20:45:16 +08:00
Eli Fayerman
fce2f2d941 docs: add safe local testing guide 2026-05-04 20:09:05 -04:00
willchen96
d9690965b5 Add local repo contents 2026-04-29 19:49:06 +02:00