Skip to content

Conversation

@sverhoeven
Copy link
Collaborator

@sverhoeven sverhoeven commented Nov 24, 2025

Fixes #158

To use requires remote URL to have CORS enabled, see https://github.com/classmodel/class-web/blob/8aaa7f869089d43a6de745bc556ae01d15caa31f/apps/class-solid/README.md#loading-experiment-from-url

  1. For happy test follow instructions in collapsed section at https://github.com/classmodel/class-web/blob/8aaa7f869089d43a6de745bc556ae01d15caa31f/apps/class-solid/README.md#loading-experiment-from-url
  2. For error test use bad url like http://localhost:3000/?e=http://localhost:3333/badurl or use same as 1 but with bad url like http://localhost:3000/?e=http://localhost:3001/death-valley.json
  3. To test loading toast do same as test 1 and use pnpm build;pnpm start and in web browser DevTools throttle network.

When state is too big for sharable link it shows

image

Copy link

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

This PR implements the ability to load experiments from remote URLs using the ?e=<url> query parameter, addressing issue #158. Users can now share experiments by hosting JSON files on CORS-enabled servers.

  • Added URL-based experiment loading via the ?e query parameter
  • Enhanced toast notifications to persist error messages with a close button
  • Provided comprehensive documentation including local development setup examples

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
apps/class-solid/src/lib/state.ts Implements loadExperimentFromUrl() function to fetch and load experiments from remote URLs, with toast-based progress feedback
apps/class-solid/src/components/ui/toast.tsx Makes error toasts persistent and adds a close button to allow users to dismiss error messages manually
apps/class-solid/README.md Documents the new URL loading feature with usage examples and local development instructions including CORS setup

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

@sverhoeven sverhoeven marked this pull request as draft November 24, 2025 11:49
Copy link

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 4 out of 4 changed files in this pull request and generated 5 comments.


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

@sverhoeven sverhoeven marked this pull request as ready for review November 24, 2025 12:59
@sverhoeven
Copy link
Collaborator Author

Do we want to show the making your own link instructions always in the share dialog?

Now you only see it when state is >32k chars.
Maybe if state is small then render own link instructions in a collapsed section

Copy link
Member

@Peter9192 Peter9192 left a comment

Choose a reason for hiding this comment

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

Very nice!


## Loading experiment from URL

A saved state (`class-<experiment-name>.json` file) can be loaded from a URL with the `s` search query parameter.
Copy link
Member

Choose a reason for hiding this comment

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

s or e? The PR top post also says e, but the screenshot of what to do when url too long says s 😕

Copy link
Member

Choose a reason for hiding this comment

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

Seems to be consistent s everywhere except in PR description

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yep, changed my mind to store whole state (s) of app instead of just one experiment (e).

@sverhoeven sverhoeven merged commit 91d3d37 into main Nov 25, 2025
4 checks passed
@sverhoeven sverhoeven deleted the remote-exp branch November 25, 2025 08:08
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.

URL too long if many soundings included

3 participants