Skip to content

self improving the extensions api#37

Merged
pablopunk merged 1 commit into
mainfrom
fractal-nvm-can-u-see-my-recent-ai-conversations-ca1262
Jun 10, 2026
Merged

self improving the extensions api#37
pablopunk merged 1 commit into
mainfrom
fractal-nvm-can-u-see-my-recent-ai-conversations-ca1262

Conversation

@pablopunk

@pablopunk pablopunk commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Summary

Verification

  • mise exec -- pnpm test

Backend API compatibility

If this PR changes backend routes, proxy/auth/token/device flows, model descriptors, rate limits, billing errors, or desktop compatibility headers:

  • Updated route-level contract tests.
  • Updated backend/src/fixtures/contracts/ fixtures when supported desktop clients depend on the changed shape.
  • Confirmed the change is additive, feature-gated, versioned, or has explicit unsupported-client update UX.

Summary by CodeRabbit

  • New Features
    • Introduced non-blocking data loading API for extensions, enabling asynchronous item resolution with automatic skeleton loading states
    • Added visual loading spinner feedback that displays while data hydrates
    • Implemented error states with user-accessible retry actions for failed data loads
    • Extended extension context API with new data loading interface

@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nvm Ready Ready Preview, Comment Jun 10, 2026 7:27pm

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

Walkthrough

This PR introduces a non-blocking data loader for extension views. Extensions can now call ctx.data.loader(fn) to return a loader handle instead of a static items array. The host recognizes the handle, renders the view immediately with empty items and isLoading: true, then spawns the loader function in the background. When the loader resolves, the host sends a view:hydrate IPC message with the hydrated items (or error) to the renderer, which updates the view accordingly. The renderer can request retry via a view:hydrate:retry IPC endpoint. Loading state renders a spinner with a 200ms debounce. Error states show a replacement preview with optional retry and dismiss actions. The feature includes a spec document, updated API contract (ExtensionView.items now accepts loader handles), host-side registry and execution logic, renderer-side event handling, and new CSS animations for the loading indicator.

Sequence Diagram

sequenceDiagram
  participant User as User/Renderer
  participant App as App.tsx
  participant Host as Host (main.ts)
  participant Extension as Extension Code
  
  Extension->>Host: return view with ctx.data.loader(fetchItems)
  Host->>Host: detect loader handle, register in viewLoaderRegistry
  Host->>App: render view with empty items, isLoading=true
  App->>App: show LoadingSpinner (after 200ms debounce)
  
  Host->>Host: spawn loader function in background
  Host->>Host: invoke fetchItems() → resolves with items
  Host->>App: send view:hydrate IPC event with items
  App->>App: receive ViewHydratePayload, match viewId
  App->>App: apply items patch, set isLoading=false
  App->>App: hide spinner, display items
  
  User->>App: click Retry action (if error occurred)
  App->>Host: invoke view:hydrate:retry IPC
  Host->>Host: re-execute loader
  Host->>App: send view:hydrate event with new result
Loading
🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is largely empty—the Summary section contains no content, and all verification/compatibility checklists are unchecked with no explanation of changes or implementation details. Fill in the Summary section with a clear overview of the new lazy data-loading feature, the affected files, and the API changes. Then verify and check off the test and compatibility items, or explain why they don't apply.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'self improving the extensions api' partially relates to the changeset, which implements a new lazy data-loading API for extensions, but it uses vague language ('self improving') that doesn't clearly describe the actual feature being added. Use a more specific, descriptive title like 'Add lazy data loading API for extension views' or 'Implement non-blocking data loader for extensions' to clearly convey the main change.
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pablopunk pablopunk merged commit b842b7b into main Jun 10, 2026
7 of 8 checks passed
@pablopunk pablopunk deleted the fractal-nvm-can-u-see-my-recent-ai-conversations-ca1262 branch June 10, 2026 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant