Skip to content

Add a button to open the scripts folder in the scripting terminal - #90

Merged
rubensworks merged 2 commits into
master-1.21-ltsfrom
terminal-ux-clean/7-open-folder
Oct 19, 2026
Merged

rubensworks merged 2 commits into
master-1.21-ltsfrom
terminal-ux-clean/7-open-folder

Conversation

@rubensworks

Copy link
Copy Markdown
Member

Stacked on #89 (then #88, #87, #86, #85).

Commit Problem before Result with this PR
Fix the scripts directory path in the info book The External Editing section said the disk folders are in world/integratedscripting/, but they are in world/integratedscripting/scripting-disks/. The path is correct.
Add a button to open the scripts folder of a disk Editing scripts in an external editor, which the info book recommends, meant finding the disk's folder inside the world save yourself. A folder button next to the "+" button below the script list opens the folder of the selected disk, creating it first if needed. Its tooltip shows the full path, which also helps when the system can't open folders. The External Editing section mentions the button.

When the button is shown

Only when this client runs the server itself (Minecraft.hasSingleplayerServer()), so in singleplayer and when hosting a LAN world. On a dedicated server, or as a LAN guest, the folder is on another computer, so the button is not added and the "+" button keeps its full width. Without a selected disk, the button is disabled.

It sits below the script list rather than in the editor toolbar: the English title only fits next to the current toolbar with a 1px margin, and the script list is where the other file action ("+") is. It is therefore not shown in focus mode.

The folder is opened with Util.getPlatform().openPath, the same call vanilla uses for "Open Resource Pack Folder", so it behaves the same on Windows, macOS and Linux.

Validation

In a dev client driven by clientdevbridge:

  • The button is shown with a folder icon in the same style as the toolbar icons, and the tooltip shows .../saves/<world>/integratedscripting/scripting-disks/1.
  • The container has no xdg-open, so I put a fake one on the client's PATH that records its arguments. A click calls it with the selected disk's folder; Minecraft logs an error instead when it's missing, as with the vanilla buttons.
  • After deleting the disk's folder, a click recreates it and opens it.
  • With the disk removed from the drive, the button is disabled, its tooltip has no path, and a click does nothing.
  • After a click the button doesn't keep a focus highlight.
  • Not tested: the button being hidden on a dedicated server, since clientdevbridge only runs a singleplayer client. That is the single hasSingleplayerServer() check above.

Testing

  • Both commits compile on their own.
  • ./gradlew build and ./gradlew runGameTestServer (23 tests) pass.

Generated by Claude Code

The External Editing section said that the directories of all disks are
in world/integratedscripting/, while they are in
world/integratedscripting/scripting-disks/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
Editing scripts in an external editor required finding the disk's folder
inside the world save. In singleplayer, and when hosting a LAN world, a
button below the script list now opens the folder of the selected disk,
creating it if needed, and its tooltip shows the folder's path. It is
hidden when playing on another server, as the folder is not on the
player's own computer then.

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/6-layout-and-files branch from 917f9c9 to bfc3760 Compare October 18, 2026 18:07
@rubensworks
rubensworks force-pushed the terminal-ux-clean/7-open-folder branch from 39f398b to 120ad29 Compare October 18, 2026 18:07
@coveralls

coveralls commented Oct 18, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 39152701083

Coverage at 42.409% (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: 3650
Covered Lines: 1686
Line Coverage: 46.19%
Relevant Branches: 1573
Covered Branches: 529
Branch Coverage: 33.63%
Branches in Coverage %: Yes
Coverage Strength: 23.03 hits per line

💛 - Coveralls

Base automatically changed from terminal-ux-clean/6-layout-and-files to master-1.21-lts October 19, 2026 17:49
@rubensworks
rubensworks merged commit 4ded9d4 into master-1.21-lts Oct 19, 2026
34 checks passed
@rubensworks
rubensworks deleted the terminal-ux-clean/7-open-folder branch October 19, 2026 17:51
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