Commit Graph

554 Commits

Author SHA1 Message Date
github-actions[bot] da5d161bad ci: version packages 2026-08-19 16:55:26 +00:00
Justin Xu 16605d9263 Preserve original row indexes when paginating extract tables.
Paginated table and list rows used the page-local map index for citation paths, so hover and click on later pages looked up the first page of field_metadata.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-18 20:49:41 -04:00
Claude b14558988e fix(ui): give each PDF source its own <Document> instance
My previous commit guessed at this race and fixed the wrong window; CI
came back with the same six errors. Reproduced it locally instead: the
trigger is `--coverage`, whose v8 instrumentation slows execution enough
to widen the window. `pnpm vitest run --coverage --project storybook
stories/file-preview/pdf-preview.stories.tsx`, with the stories pointed
at the local fixture so documents actually load, reproduces all six.

Instrumenting react-pdf showed the real sequence, all of it inside the
`Upload And Preview` story, which swaps the url mid-play:

  loadDocument RUN x2   <- document B starts while A is in flight
  destroy EXECUTED      <- A torn down
  PageMount x6          <- all with a null messageHandler

react-pdf's loader schedules `loadingTask.destroy()` on cleanup but never
cancels that task's pending RESOLVE dispatch, so a superseded document
still lands in context and is then destroyed. Any <Page> mounting against
it throws. No gating on our own state can prevent that — the stale pdf
arrives from inside react-pdf after we have already moved on.

Keying <Document> by url gives each source a fresh instance, so the
stale resolve dispatches into an unmounted reducer and is a no-op.
Verified against the reproduction: 216 page mounts, all with a live
transport, zero errors (was 152 live / 6 dead).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CJXCdQUoysxwoDBaDoDp2b
2026-07-28 18:08:42 +00:00
Claude c7ffb82463 fix(ui): don't render PDF pages after their document is torn down
Self-hosting the worker made pdf.js use a real Worker in CI where the
unpkg script had been falling back to the in-process fake worker, which
turned a latent race into six unhandled errors on every run:

  TypeError: Cannot read properties of null (reading 'sendWithPromise')
    at WorkerTransport.getPage

On a `url` change the effect cleanup cleared `file`, so react-pdf
destroyed the document's worker transport — but `numPages` was left set,
and it alone gated the page list. Any <Page> mounting in that commit
called getPage() on the dead transport. The virtualized list mounts and
unmounts pages continuously, so the window was easy to hit once page
loads became genuinely async; `UploadAndPreview` swaps the url mid-story
and hit it six times under CI's timing.

Clear `numPages` alongside `file`, and include `file` in the render
guard so pages can never outlive their document.

The regression test mocks react-pdf with the same contract the real
library has — a Page mounting without a Document file throws — so the
invariant is pinned deterministically rather than depending on pdf.js
timing. It fails without this fix.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CJXCdQUoysxwoDBaDoDp2b
2026-07-28 17:40:44 +00:00
Claude bf0935e2f4 fix(ui): load pdf.js worker from app origin instead of unpkg
The PDF viewer set `pdfjs.GlobalWorkerOptions.workerSrc` to a script on
unpkg.com, and pointed `cMapUrl`/`wasmUrl` at the same CDN. The worker
executes with the host page's privileges, so a hijacked or compromised
CDN response had full access to the application origin — on every page
that previews a document. It also forced consuming apps to allow
https://unpkg.com in their CSP `script-src` and `worker-src`.

Resolve the worker from the `pdfjs-dist` package installed alongside the
library so bundlers emit it as a same-origin asset, and add
`configurePdfjs()` for apps that need to point at self-hosted copies
explicitly. `pdfjs-dist` is pinned to the exact build react-pdf uses,
since pdf.js rejects a worker whose version differs from the API's; a
test guards that pin against drift.

`cMapUrl`/`wasmUrl` are no longer set by default — they are directories
bundlers cannot resolve automatically, so they become opt-in via
`configurePdfjs()`. Documented in the package README.

The es2017 tsup target lowered `import.meta` to `{}`, which would have
silently reduced the worker to pdf.js's main-thread fallback, so
`import-meta` is now preserved for the ESM output.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CJXCdQUoysxwoDBaDoDp2b
2026-07-28 17:09:14 +00:00
github-actions[bot] e9d7176a4f ci: version packages 2026-07-13 21:23:59 +00:00
Yong 32650a457f cleanup on dropzone border 2026-07-13 14:13:41 -07:00
Yong 6f361527b1 add dark mode + redo storybook examples 2026-07-13 14:03:40 -07:00
github-actions[bot] 384f21f641 ci: version packages 2026-06-05 00:16:15 +00:00
yongpark 644afa3c9c chore: auto-fix Code Quality issues 2026-06-05 00:04:03 +00:00
Yong 13d0ef33af increase performance for pdf preview 2026-06-04 16:54:56 -07:00
github-actions[bot] 98e7721604 ci: version packages (#362) 2026-04-21 19:25:24 -04:00
Adrian Lyjak 6a4e22613d feat(ui): resume subscribeToEvents from last-seen sequence (#359) 2026-04-21 18:23:09 -04:00
github-actions[bot] dc022fd654 ci: version packages 2026-04-21 21:01:01 +00:00
Yong c49dc5243a add controllable scale for doc previews 2026-04-21 13:41:25 -07:00
github-actions[bot] df31bb688b ci: version packages 2026-04-16 22:20:02 +00:00
yongpark 02b430d9fc chore: auto-fix Code Quality issues 2026-04-16 22:04:58 +00:00
Yong 2f598e1af1 adding support ofr html, docx, pptx for file preview 2026-04-16 14:59:55 -07:00
Terry Zhao 1804e3dbe4 Merge pull request #121 from run-llama/cursor/LI-3766-fix-boolean-field-editing-in-nested-structures-f69e
Fix boolean field editing in nested structures
2026-04-06 14:58:00 -07:00
Terry Zhao 190273bb75 Merge pull request #337 from run-llama/update-workflows-sdk
chore: update workflows SDK
2026-04-06 14:56:42 -07:00
llama-org-ci-bot[bot] 9df4b5c6b9 chore: update workflows SDK to v0.3.2 2026-04-02 18:09:36 +00:00
github-actions[bot] ef785ad4b6 ci: version packages 2026-03-26 00:18:12 +00:00
Terry Zhao c8437e39b6 fix(ui): address review comments on resizable panels upgrade
- Fix P1: Separator aria-orientation is perpendicular to group orientation
  in v4 (horizontal group → vertical separator). Flip CSS selectors from
  aria-[orientation=vertical] to aria-[orientation=horizontal] for the
  vertical-group case.

- Fix P1: Implement autoSaveId via useDefaultLayout hook. v4 removed
  autoSaveId as a Group prop; it now requires useDefaultLayout({ id,
  storage }) which returns defaultLayout + onLayoutChanged. Added a
  separate component to handle the hook call.

- Fix P2: Add missing props (disabled) to ResizablePanelGroupProps and
  ResizablePanelProps that were previously available via passthrough.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 17:09:11 -07:00
zhaotai 1a1ee10b73 chore: auto-fix Code Quality issues 2026-03-25 23:54:53 +00:00
Terry Zhao 09b3daee48 fix(ui): upgrade react-resizable-panels v3→v4, encapsulate dependency types
Upgrade react-resizable-panels from ^3.0.3 to ^4.1.0 (resolves to 4.7.6)
to fix a known race condition in useGroupRef/usePanelRef hooks that caused
intermittent "No group found for id" errors during SSR hydration with
React 19's useId().

Define owned prop types for ResizablePanelGroup, ResizablePanel, and
ResizableHandle instead of re-exporting the dependency's types. This
ensures future dependency upgrades don't leak breaking changes to
consumers.

Key changes:
- Own prop types for all three components (no dependency type leakage)
- Accept both `direction` and `orientation` on ResizablePanelGroup
- Adapt v4 onResize callback (PanelSize → number) for backwards compat
- Update CSS selectors: data-[panel-group-direction] → aria-[orientation]
- Update story file to use orientation prop
- Bump version to 4.2.0 (non-breaking for consumers)

Ref: https://github.com/bvaughn/react-resizable-panels/issues/204

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 16:54:01 -07:00
Cursor Agent b1f48a1331 chore: add changeset for ButtonGroup feature (minor bump)
Reverts manual version bump in favor of changeset workflow.

Co-authored-by: Terry Zhao <zhaotai5541@gmail.com>
2026-03-17 02:43:27 +00:00
Cursor Agent 7ec15c62a8 chore: bump version to 4.2.0 for ButtonGroup feature
Co-authored-by: Terry Zhao <zhaotai5541@gmail.com>
2026-03-17 02:40:14 +00:00
zhaotai 11e16a93d7 chore: auto-fix Code Quality issues 2026-03-17 02:36:58 +00:00
Cursor Agent 1c4bed6dd1 feat: export ButtonGroup from shadcn with Storybook stories
- Add ButtonGroup/ButtonGroupItem to base/index.ts and src/index.ts
- Add ./base/button-group subpath export in package.json
- Add comprehensive Storybook stories covering all variants,
  orientations, sizes, icon-only, mixed variants, disabled states

Co-authored-by: Terry Zhao <zhaotai5541@gmail.com>
2026-03-17 02:35:32 +00:00
Cursor Agent 996fb1b65f feat: add ButtonGroup component with tests
- ButtonGroup container with horizontal/vertical orientation
- ButtonGroupItem with shared variant/size context from parent
- Position-aware border-radius for connected button styling
- Supports individual variant/size overrides per item
- Full test coverage with 14 passing tests

Co-authored-by: Terry Zhao <zhaotai5541@gmail.com>
2026-03-17 02:33:18 +00:00
github-actions[bot] 94c720b9dc ci: version packages 2026-03-13 21:10:13 +00:00
Yong 5532cbb53d soften palette 2026-03-13 10:53:09 -07:00
Yong 8cff9bfc2c fix datatable button and button styling 2026-03-13 10:17:24 -07:00
Yong be0ba62cc9 dark mode + stories 2026-03-13 10:08:33 -07:00
yongpark 64621b387e chore: auto-fix Code Quality issues 2026-03-12 23:36:45 +00:00
Yong f5084d2ee4 fix lint 2026-03-12 16:35:59 -07:00
Yong 27e6890c16 update styling and harden components 2026-03-12 16:34:30 -07:00
yongpark 10fe377f20 chore: auto-fix Code Quality issues 2026-03-12 23:01:27 +00:00
Yong 4ff967d30f remove unused import 2026-03-12 16:00:35 -07:00
Yong cca2018666 perf updates for datatable and multipleselector 2026-03-12 15:59:48 -07:00
yongpark bac1194595 chore: auto-fix Code Quality issues 2026-03-12 22:52:15 +00:00
Yong e80dc66e08 update input accessibility 2026-03-12 15:51:25 -07:00
yongpark 7c8c5f6b41 chore: auto-fix Code Quality issues 2026-03-12 18:14:00 +00:00
Yong be7d5f8cc5 normalize colors for ui components 2026-03-12 11:11:04 -07:00
github-actions[bot] 7b49353512 ci: version packages 2026-02-20 18:02:52 +00:00
leehuwuj c8c17498c6 fix linting 2026-02-20 10:50:35 +07:00
leehuwuj ee8c435741 remove unused components 2026-02-20 10:46:49 +07:00
leehuwuj e1ac815b1a add new reusable components 2026-02-19 14:30:01 +07:00
leehuwuj 1e845869fb add new radix-ui components 2026-02-19 14:22:44 +07:00
github-actions[bot] 47c6614e3e ci: version packages (#334)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-18 18:28:29 -05:00