Skip to content

Scripting terminal: show the last evaluation of the bound card - #95

Merged
rubensworks merged 2 commits into
master-1.21-ltsfrom
terminal-ux-clean/10-last-value
Oct 20, 2026
Merged

rubensworks merged 2 commits into
master-1.21-ltsfrom
terminal-ux-clean/10-last-value

Conversation

@rubensworks

Copy link
Copy Markdown
Member

Stacked on #94.

Before this, you had to walk to a display panel to see what a script member evaluates to, or why it fails. Now, hovering the "Bound to: …" label shows:

  • Last value: 42 once the network has evaluated the member
  • Last error: … when reading it failed, for example a ReferenceError at the top level or a syntax error
  • Last error when called: … when calling the member as a function threw, for example inside a filter
  • Not evaluated by the network since the script last changed before any evaluation, or after an edit

Values are recorded only where the network already evaluates. Nothing is evaluated just for the tooltip, so they're labeled "last".

How it works:

  • ScriptEvaluationStatuses keeps one entry per (disk, path, member). It's written from ScriptVariable.getValue and from the script exception factory.
  • Each entry remembers the script text it was recorded for, so edits make it stale without needing listeners.
  • It's cleared on server stop.
  • The terminal syncs the lines for the card in its slot through a value notifier, and only sends when they change.

Validation:

  • New game tests testScriptsEvaluationStatus (none, then value, then read error after an edit) and testScriptsEvaluationStatusCallError (a function that throws, applied in a display panel).
  • build and runGameTestServer (25/25) pass.
  • In-game: value 42, then a ReferenceError after breaking the script, then 60 after fixing it. For the recovery step I temporarily applied Fix display panels not recovering from script errors after external edits #91 locally, since external edits otherwise don't recover on this base.

Generated by Claude Code

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 39205496474

Coverage at 45.501% (no base build to compare)

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 3870
Covered Lines: 1892
Line Coverage: 48.89%
Relevant Branches: 1765
Covered Branches: 672
Branch Coverage: 38.07%
Branches in Coverage %: Yes
Coverage Strength: 24.32 hits per line

💛 - Coveralls

Hovering the binding label of a bound card now shows the last value or
error of its member as evaluated by the network, and the last error from
calling it as a function. It shows that it was not evaluated yet when the
script changed since.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
@rubensworks
rubensworks force-pushed the terminal-ux-clean/9-toplevel-binding branch from 856c391 to 62276da Compare October 19, 2026 05:37
@rubensworks
rubensworks force-pushed the terminal-ux-clean/10-last-value branch from a7b646b to ad76d8b Compare October 19, 2026 05:37
Base automatically changed from terminal-ux-clean/9-toplevel-binding to master-1.21-lts October 19, 2026 17:54
…x-clean/10-last-value

# Conflicts:
#	src/main/java/org/cyclops/integratedscripting/gametest/GameTestsScripts.java
@rubensworks
rubensworks merged commit c75339c into master-1.21-lts Oct 20, 2026
23 checks passed
@rubensworks
rubensworks deleted the terminal-ux-clean/10-last-value branch October 20, 2026 17:03
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