Skip to content

fix(tutorial): keep input bar mounted and focused during command entry - #66

Merged
nschimme merged 1 commit into
MUME:masterfrom
nschimme:fix-tutorial-input-focus-15706434561140465532
Sep 21, 2026
Merged

nschimme merged 1 commit into
MUME:masterfrom
nschimme:fix-tutorial-input-focus-15706434561140465532

Conversation

@nschimme

@nschimme nschimme commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Prevent the tutorial prompt bar from unmounting when output overflows, ensuring continuous keyboard focus when entering commands like look and exits. Display a non-blocking floating overlay toast when content overflows.

Summary by Sourcery

Preserve continuous tutorial command entry by keeping the input bar mounted and presenting overflow paging as a floating toast.

Bug Fixes:

  • Keep the tutorial command input mounted and accessible while output overflow is being paged, preserving continuous keyboard focus.

Enhancements:

  • Replace the blocking pager input state with a non-blocking floating overflow toast while retaining the normal command entry bar.

Tests:

  • Update tutorial player coverage to verify the input remains mounted and accessible across successive quest commands.

Prevent the tutorial prompt bar from unmounting <input> when output
overflows, ensuring continuous keyboard focus when entering commands
like `look` and `exits`. Display a non-blocking floating overlay toast
when content overflows.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry @nschimme, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 3 hours and 31 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

@nschimme
nschimme merged commit 413848f into MUME:master Sep 21, 2026
2 checks passed
@sourcery-ai

sourcery-ai Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

The tutorial player now preserves a continuously mounted command input while output is paged, adding a transitional floating overflow toast for navigation and updating tests to verify the input remains accessible after submitting a command.

Sequence diagram for continuous tutorial command input focus

sequenceDiagram
    actor User
    participant Input as CommandInput
    participant Player as TutorialPlayer
    participant Toast as OverflowToast

    User->>Input: submit()
    Input->>Player: @keydown.enter
    Player-->>Input: keep mounted and focused
    Player->>Toast: show when isScrollOverflowActive && !isScrolling
    User->>Toast: click
    Toast->>Player: pageForward(true)
    Player-->>Input: remain available for next command
Loading

Flow diagram for tutorial prompt and overflow states

flowchart TD
    A["Tutorial prompt rendered"] --> B{"Chapter complete?"}
    B -->|Yes| C["Show completion button"]
    B -->|No| D["Keep command input mounted"]
    D --> E{"Output overflow active and not scrolling?"}
    E -->|Yes| F["Show floating overflow toast"]
    E -->|No| G["Show input without toast"]
    F --> H["pageForward(true)"]
    H --> D
Loading

File-Level Changes

Change Details Files
Keep the command input mounted during output paging so keyboard focus and subsequent command entry are preserved.
  • Remove the overflow-pager branch that replaced the input with a button.
  • Render the input alongside a conditional overflow action instead of unmounting it.
  • Retain the chapter-complete state as the only mode that replaces the input bar.
docs/.vitepress/theme/components/TutorialPlayer.vue
Present overflow navigation as a non-blocking floating toast within the prompt bar.
  • Add a transition-wrapped pager toast that advances output on click.
  • Position the prompt container for overlay placement and remove pager-specific prompt styling.
docs/.vitepress/theme/components/TutorialPlayer.vue
Update coverage to verify the input remains available after command submission.
  • Replace the pager readonly assertion with a mounted-input assertion across successive commands.
tests/tutorial_player.test.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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