Skip to content

Show endpoint and tips when emulator is already running#181

Merged
gtsiolis merged 3 commits intomainfrom
des-194-improve-output-when-emulator-is-already-running
Apr 21, 2026
Merged

Show endpoint and tips when emulator is already running#181
gtsiolis merged 3 commits intomainfrom
des-194-improve-output-when-emulator-is-already-running

Conversation

@gtsiolis
Copy link
Copy Markdown
Member

@gtsiolis gtsiolis commented Mar 28, 2026

This will:

  1. Show the endpoint, web app URL, and a random tip when the emulator is already running, matching the start output.
  2. Render the "already running" message as a note (> Note:) instead of a plain info line
BEFORE AFTER
Screenshot 2026-04-21 at 18 57 44 Screenshot 2026-04-21 at 18 57 49

Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 1a21200a-816f-415b-903b-437f0b003afc

📥 Commits

Reviewing files that changed from the base of the PR and between d2de6da and 386ce82.

📒 Files selected for processing (2)
  • internal/container/start.go
  • internal/ui/app.go

📝 Walkthrough

Walkthrough

The changes modify the post-start output flow to pass endpoint and web app URL information through the container start process. When containers are already running, message output switches to note-level severity with endpoint details emitted. The UI layer adds a new message handler to hide headers when note-severity messages are received.

Changes

Cohort / File(s) Summary
Container start flow
internal/container/start.go
Start function now passes LocalStackHost and WebAppURL to selectContainersToStart. When a running container is detected, the message type changes from info to note, and endpoint host resolution with emitPostStartPointers is invoked before continuing.
UI message handling
internal/ui/app.go
Added hideHeaderMsg message type handled in App.Update to set a.hideHeader = true. For output.MessageEvent, a command is conditionally scheduled when severity is output.SeverityNote to trigger header hiding.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • carole-lavillonniere
  • silv-io
  • anisaoshafi
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: showing endpoint and tips when the emulator is already running, which matches the primary modifications in the PR.
Description check ✅ Passed The description is clearly related to the changeset, explaining the three main objectives and providing visual before/after comparisons of the changes made.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch des-194-improve-output-when-emulator-is-already-running

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread internal/ui/app.go Outdated
msgCopy := msg
line := styledLine{text: components.RenderMessage(msg), message: &msgCopy}
var cmd tea.Cmd
if msg.Severity == output.SeverityNote {
Copy link
Copy Markdown
Contributor

@anisaoshafi anisaoshafi Mar 30, 2026

Choose a reason for hiding this comment

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

UX wise looks good 🧹

Question: This is going to hide the TUI header for all SeverityNote messages, not only in the case emulator is running. Is this expected @gtsiolis?

Copy link
Copy Markdown
Member Author

@gtsiolis gtsiolis Apr 21, 2026

Choose a reason for hiding this comment

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

Good point, @anisaoshafi. Now that the banner is more functional with plan and config path with #180, we can leave it as is for now. In the future we may add a boolean to hie the banner per case.

Cc @carole-lavillonniere

@gtsiolis gtsiolis force-pushed the des-194-improve-output-when-emulator-is-already-running branch from 386ce82 to 2689ca1 Compare April 21, 2026 14:20
Comment thread internal/container/start.go Outdated
if running {
output.EmitInfo(sink, "LocalStack is already running")
output.EmitNote(sink, "LocalStack is already running")
resolvedHost, _ := endpoint.ResolveHost(c.Port, localStackHost)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should check the result dnsOK of ResolveHost like we do line 227 in current file

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Nice one, added in 41add77.

@gtsiolis gtsiolis force-pushed the des-194-improve-output-when-emulator-is-already-running branch from 2689ca1 to 6a8bd35 Compare April 21, 2026 15:58
@gtsiolis
Copy link
Copy Markdown
Member Author

Thanks both, @anisaoshafi and @carole-lavillonniere!

Copy link
Copy Markdown
Contributor

@anisaoshafi anisaoshafi left a comment

Choose a reason for hiding this comment

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

LGTM! ✨

Comment thread internal/container/start.go Outdated
@gtsiolis gtsiolis merged commit cb3960e into main Apr 21, 2026
6 checks passed
@gtsiolis gtsiolis deleted the des-194-improve-output-when-emulator-is-already-running branch April 21, 2026 16:28
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