Skip to content

Conversation

@stephenliang
Copy link
Member

@stephenliang stephenliang commented Feb 7, 2026

This PR introduces a new API client for interacting with Dashboard. The client uses "type-ahead" syntax to improve the understanding of different API nouns and predict what data may be retrieved.

Additionally, this PR adds a blanket allow for the development rails server to allow CORS when visiting code studio via localhost-studio.code.org:*. This allows the vite local and rails-vite apps to be able to communicate with the development server. This does not allow CORS outside of development.

@github-actions
Copy link

github-actions bot commented Feb 7, 2026

🖼️ Storybook Visual Comparison Report

✅ No Storybook eyes differences detected!

@stephenliang stephenliang force-pushed the stephen/dashboard-api-client branch from 39093a3 to 6925828 Compare February 10, 2026 21:39
@stephenliang stephenliang changed the title initial api test feat(core): add ky based api client Feb 10, 2026
@stephenliang stephenliang requested a review from Copilot February 10, 2026 21:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new ky-backed Dashboard API client to @code-dot-org/core (with a singleton instance + typed “noun”-style access), and updates dev configuration to support local CORS/host access for Code Studio + Vite apps.

Changes:

  • Introduces @code-dot-org/core/api entrypoint exporting DashboardApiClient and related dashboard response/request types.
  • Adds typed endpoints for Labs level properties and user preference theme, using a bound ky transport.
  • Updates dev configs to allow requests from localhost-studio.code.org (Vite allowed hosts; Rails dev CORS).

Reviewed changes

Copilot reviewed 18 out of 19 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
frontend/packages/labs/music/vite.config.ts Allows Vite dev server access when using localhost-studio.code.org.
frontend/packages/labs/music/src/App.tsx Demonstrates using DashboardApiClient to fetch level properties and theme.
frontend/packages/core/vite.config.ts Adds an additional library entrypoint for the new API bundle.
frontend/packages/core/src/api/index.ts Exposes DashboardApiClient and dashboard API types from a new ./api export path.
frontend/packages/core/src/api/dashboard/** Adds ky-bound dashboard client factory, singleton transport, and initial endpoint modules/types.
frontend/packages/core/package.json Adds ./api subpath export and ky dependency.
frontend/apps/studio/package.json Adds ky dependency for the studio app.
dashboard/config/initializers/development_cors.rb Enables dev-only CORS for localhost-studio.code.org:<port> with credentials.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@stephenliang stephenliang force-pushed the stephen/dashboard-api-client branch from 6925828 to b7309dc Compare February 10, 2026 21:47
@stephenliang stephenliang requested a review from Copilot February 10, 2026 21:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 19 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@stephenliang stephenliang force-pushed the stephen/dashboard-api-client branch from b7309dc to 7368665 Compare February 10, 2026 21:51
This PR introduces a new API client for interacting with Dashboard. The
client uses "type-ahead" syntax to improve the understanding of
different API nouns and predict what data may be retrieved.

Additionally, this PR adds a blanket allow for the development rails
server to allow CORS when visiting code studio via
`localhost-studio.code.org:*`. This allows the vite local and rails-vite
apps to be able to communicate with the development server. This does
not allow CORS outside of development.
@stephenliang stephenliang force-pushed the stephen/dashboard-api-client branch from 7368665 to a55cc25 Compare February 10, 2026 21:53
@stephenliang stephenliang marked this pull request as ready for review February 10, 2026 21:56
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