8000 Interactive eval by georgefst · Pull Request #1351 · hackworthltd/primer · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Interactive eval #1351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 4, 2025
Merged

Interactive eval #1351

merged 6 commits into from
Jun 4, 2025

Conversation

georgefst
Copy link
Contributor
@georgefst georgefst commented May 21, 2025

As mentioned in the last commit message, this is still kind of proof-of-concept, but it works rather well.

And even with less-than-perfect UX, it feels great to be able to explore eval steps again, seeing as we never got this far with the JS frontend. This brings back a key Primer feature which we effectively haven't had for three and a half years!

@dhess dhess marked this pull request as draft May 21, 2025 19:20
@georgefst georgefst force-pushed the georgefst/eval-mode branch 2 times, most recently from 3dbc461 to c83de10 Compare May 29, 2025 14:17
@georgefst georgefst force-pushed the georgefst/eval-mode branch 2 times, most recently from 35b0c19 to f3610da Compare June 1, 2025 16:39
@georgefst georgefst marked this pull request as ready for review June 1, 2025 16:42
@georgefst georgefst requested a review from dhess June 1, 2025 16:42
@georgefst georgefst force-pushed the georgefst/eval-mode branch from f3610da to 95e2d03 Compare June 1, 2025 17:05
georgefst added 6 commits June 2, 2025 01:50
Will allow other uses and extra constructors.

Signed-off-by: George Thomas <georgefsthomas@gmail.com>
This is unused for now.

Signed-off-by: George Thomas <georgefsthomas@gmail.com>
Signed-off-by: George Thomas <georgefsthomas@gmail.com>
…ions

Signed-off-by: George Thomas <georgefsthomas@gmail.com>
IDs should be unique within a page, so it's best to be careful to avoid clashes.

Signed-off-by: George Thomas <georgefsthomas@gmail.com>
This is a proof-of-concept, with UI choices being driven largely by implementation simplicity. One quirk is that we can't change eval opts on the fly during interactive evaluation, because this resets the evaluation state completely, i.e. it takes the history back to a singleton list. This is because we also want full (i.e. non-interactive) eval to be in sync with the opts.

Note that we no longer show the timeout error, since we now consider timing out to be fine and normal, as interaction can be continued interactively. Besides, it's obvious whether an expression has finished eval, by whether there are redexes highlighted (at least for small expressions), and anyway, the old `"No selection for eval"` message was never actually shown, since we mistakenly didn't show the `error` field when `expr` was `Nothing`. We still show `"No definition selected for evaluation"`, so nothing has been lost with this change. For similar reasons, we set `stepLimit = 0`, instead of the arbitrary `stepLimit = 10`, which is also consistent with using `False` for checkboxes, in terms of initial state being reflected in the UI.

Signed-off-by: George Thomas <georgefsthomas@gmail.com>
Copy link
Member
@dhess dhess left a comment

Choose a reason for hiding this comment

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

Amazing, thanks!

@dhess dhess added this pull request to the merge queue Jun 4, 2025
Merged via the queue into main with commit 1bb6683 Jun 4, 2025
53 checks passed
@dhess dhess deleted the georgefst/eval-mode branch June 4, 2025 12:05
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.

2 participants
0