Skip to content

fix(repl): set_evaluator() alone should open the Repl tab - #876

Merged
martin-henz merged 1 commit into
masterfrom
fix-repl-set-evaluator-tab-load
Aug 2, 2026
Merged

fix(repl): set_evaluator() alone should open the Repl tab#876
martin-henz merged 1 commit into
masterfrom
fix-repl-set-evaluator-tab-load

Conversation

@martin-henz

Copy link
Copy Markdown
Member

Summary

Reported repro:

from repl import set_evaluator
from rune import show, heart

def dummy(code):
    pass

set_evaluator(dummy)

No Repl tab appears. This is not rune-related (show/heart are imported but never called, so rune's tab correctly staying hidden is expected) - it reproduces with repl alone.

Root cause

ReplModulePlugin.set_evaluator (src/bundles/repl/src/index.ts) never called the private lazy tab-loader __loadReplTab(). Every other function that gives a student a reason to look at the tab already does (set_program_text, repl_display/rich_repl_display via __displayOutput, set_background_image/set_font_size via __displayEditorProps) - set_evaluator was the one exception, missed when this lazy-load pattern was introduced during the Conductor migration (#865).

Since the tab is only ever constructed via that loader, a program whose only interaction with the module is set_evaluator() - exactly the module's own documented minimal usage example in the file's module doc comment - never opened the tab at all.

Fix

set_evaluator now calls this.__loadReplTab() after registering the evaluator, matching the existing pattern used by every other tab-opening method.

Test plan

  • yarn tsc and yarn lint pass for src/bundles/repl and src/tabs/Repl
  • Existing test suites pass (43 bundle tests, 12 tab tests) - unaffected
  • Verified the compiled bundle output directly: set_evaluator now calls __loadReplTab() (4 call sites total, up from 3)
  • Could not add a unit test asserting this directly in the usual style (tabLoader.loadTab called after set_evaluator()) - vitest's transform currently fails to import the plugin class (index.ts) for any bundle using the newer "standard decorators" syntax (binary_tree, matrix, midi, pix_n_flix, repeat, repl, sound). This is a pre-existing tooling gap, not something new from this change - none of those bundles currently have a test importing their own index.ts. Flagging in case it's worth a separate look.

🤖 Generated with Claude Code

https://claude.ai/code/session_01B3LRoXRMQ5ADeYMdVTChCZ

set_evaluator() was the one repl function that gave a program a
reason to use the tab but never actually triggered the lazy tab
loader - every other producing/customizing function (set_program_text,
repl_display, set_background_image, ...) already calls
__loadReplTab(), but set_evaluator() was missed when the lazy-load
pattern was introduced in the Conductor migration (#865).

As a result, a program whose only interaction with the module is
set_evaluator() - exactly the module's own documented minimal usage
example - never opened the Repl tab at all.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B3LRoXRMQ5ADeYMdVTChCZ
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@martin-henz
martin-henz merged commit 93a16bc into master Aug 2, 2026
12 checks passed
@martin-henz
martin-henz deleted the fix-repl-set-evaluator-tab-load branch August 2, 2026 10:26
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.

1 participant