Skip to content

Add focus mode and script renaming to the scripting terminal - #89

Merged
rubensworks merged 5 commits into
master-1.21-ltsfrom
terminal-ux-clean/6-layout-and-files
Oct 19, 2026
Merged

rubensworks merged 5 commits into
master-1.21-ltsfrom
terminal-ux-clean/6-layout-and-files

Conversation

@rubensworks

@rubensworks rubensworks commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

Replaces #82, with the same changes and a clean commit history: every commit is one standalone change. Phase 6, the last of the scripting terminal UX stack.

I checked each problem in a dev client driven by clientdevbridge before fixing it, then checked it again with this branch.

Commit Problem before Result with this PR
Show full script paths when hovering the script list inventory_sorting_main.js and inventory_sorting_test.js both showed as inventory_sorting..., and lib/helpers/math_utils.js was cut off. Hovering a script shows its full path. The tooltip isn't drawn over open dialogs.
Allow renaming scripts in the scripting terminal New scripts were always scriptN.js, and could only be renamed or moved through the file system, which players on a server can't reach. Right-click a script for a rename dialog, and the hover tooltip mentions this. A path like util/a/new.js moves it into folders, and changing the extension changes its language. The open script stays open with its undo history. Checked in-game: renames into new folders keep content on disk; renaming onto an existing name is refused; ../escape.js is rejected by the server, which then corrects the client, and nothing is written outside the disk folder. Includes a unit test that a file watcher reload doesn't undo a rename that isn't flushed to disk yet, and a line in the info book's shortcuts section.
Add a focus mode to enlarge the script editor (see #44) The editor is 168×115 GUI pixels: 7 lines of the sample script, wrapped. A toolbar button switches to an editor using most of the screen: 22 unwrapped lines at GUI scale 3. The toolbar moves along above the enlarged editor, so all actions stay reachable. Escape or the button goes back. Typing, scrolling and the cursor position carry over, and clicks don't reach the hidden slots. The title margin is reduced so the English title still fits next to the extra button; pt_br is cut off with …. The info book's shortcuts section mentions Escape.
Warn that renaming a script breaks its variable cards Cards refer to scripts by disk and path, so renaming a script silently breaks every card bound to it. The rename dialog shows "Variable cards bound to this script will stop working." between the input and the buttons. The text is scaled down further for longer translations.
Add a rebindable hotkey to enlarge the script editor The enlarged editor could only be toggled with its button. F12 toggles it, and can be changed in the Controls settings. F11 is taken by Minecraft's own fullscreen toggle. The editor keeps keyboard focus, so typing continues. The button tooltips show the keys ("Enlarge editor (F12)", "Back to normal size (Escape, F12)"), and the key is listed in the info book's shortcuts section.

A fix for a resize data-loss bug I found while working on this (the editor came back empty after a window resize, and the next keystroke overwrote the script) went into #77, which is merged.

Dropped from the original plan

  • Disk labels: the disk item's tooltip already shows its ID, so disks can already be matched to the terminal's disk selector.
  • Marking .stdout/.stderr log files: they already open as readable text in the terminal, and I found no actual problem with how they're shown today.
  • Delete key to delete scripts: the existing delete button covers it.

Testing

  • Every commit compiles on its own, including tests and Spotless.
  • ./gradlew build passes, including the new unit test.
  • ./gradlew runGameTestServer: all 23 tests pass.
  • Smoke-tested in-game on this branch: toolbar, find bar, enlarged editor in and out with the button and F12, rename dialog with its warning.

Generated by Claude Code

@coveralls

coveralls commented Oct 18, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 39294249802

Coverage decreased (-2.5%) to 42.542%

Details

  • Coverage decreased (-2.5%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 408 coverage regressions across 9 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

408 previously-covered lines in 9 files lost coverage.

File Lines Losing Coverage Coverage
org/cyclops/integratedscripting/client/gui/container/ContainerScreenTerminalScripting.java 277 0.0%
org/cyclops/integratedscripting/inventory/container/ContainerTerminalScripting.java 43 38.3%
org/cyclops/integratedscripting/client/gui/component/input/WidgetDialog.java 41 0.0%
org/cyclops/integratedscripting/core/network/ScriptingData.java 35 80.41%
org/cyclops/integratedscripting/client/key/Keys.java 3 68.42%
org/cyclops/integratedscripting/core/evaluate/ScriptVariable.java 3 81.25%
org/cyclops/integratedscripting/core/network/GraalScriptFactory.java 3 60.53%
org/cyclops/integratedscripting/client/gui/image/ScriptImages.java 2 0.0%
org/cyclops/integratedscripting/proxy/CommonProxy.java 1 88.89%

Coverage Stats

Coverage Status
Relevant Lines: 3638
Covered Lines: 1687
Line Coverage: 46.37%
Relevant Branches: 1571
Covered Branches: 529
Branch Coverage: 33.67%
Branches in Coverage %: Yes
Coverage Strength: 23.11 hits per line

💛 - Coveralls

Paths in the script list are truncated, so files with a common prefix,
such as inventory_sorting_main.js and inventory_sorting_test.js, or
files in subdirectories could not be told apart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
New scripts were always named script0.js, script1.js and so on, and could
only be renamed or moved into directories through the file system, which
players on a server can't access. Right-click a script to rename it,
which also allows moving it into a directory or changing its language
through its extension.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
The editor only uses a small part of the screen, showing about a dozen
wrapped lines. Add a toolbar button to show only the editor, using most
of the screen, with the toolbar moving along above it. Escape or the
button returns to the normal terminal.

See #44

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/5-highlighting-performance branch from a7c8067 to f105ac8 Compare October 18, 2026 18:07
@rubensworks
rubensworks force-pushed the terminal-ux-clean/6-layout-and-files branch from 917f9c9 to bfc3760 Compare October 18, 2026 18:07
Base automatically changed from terminal-ux-clean/5-highlighting-performance to master-1.21-lts October 19, 2026 17:05
Variable cards refer to scripts by path, so they stop working when their
script is renamed. The rename dialog now says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
The enlarged editor could only be toggled with its button. F12 now toggles
it too, as F11 is used by Minecraft for fullscreen, and keeps the editor
focused so typing can continue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
@rubensworks
rubensworks merged commit aa707d8 into master-1.21-lts Oct 19, 2026
23 checks passed
@rubensworks
rubensworks deleted the terminal-ux-clean/6-layout-and-files branch October 19, 2026 17:49
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.

3 participants