Skip to content

Make status command output easier to read#243

Merged
gtsiolis merged 1 commit into
mainfrom
des-229-make-status-command-output-easier-to-read
May 13, 2026
Merged

Make status command output easier to read#243
gtsiolis merged 1 commit into
mainfrom
des-229-make-status-command-output-easier-to-read

Conversation

@gtsiolis
Copy link
Copy Markdown
Member

BEFORE AFTER
Screenshot 2026-05-13 at 00 31 29 Screenshot 2026-05-13 at 00 31 18

Copy link
Copy Markdown
Collaborator

@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.

This looks much neater ✨ thank you!

Comment thread internal/ui/app.go Outdated
Comment on lines +298 to +309
a.addLine(styledLine{text: styles.Success.Render(output.SuccessMarker()) + " " + msg.EmulatorName + " is running"})
if msg.Host != "" {
a.addLine(styledLine{text: "• Endpoint: " + msg.Host, secondary: true})
}
if msg.ContainerName != "" {
a.addLine(styledLine{text: "• Container: " + msg.ContainerName, secondary: true})
}
if msg.Version != "" {
a.addLine(styledLine{text: "• Version: " + msg.Version, secondary: true})
}
if msg.Uptime > 0 {
a.addLine(styledLine{text: "• Uptime: " + output.FormatUptime(msg.Uptime), secondary: true})
Copy link
Copy Markdown
Collaborator

@anisaoshafi anisaoshafi May 13, 2026

Choose a reason for hiding this comment

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

This code is mostly duplicate across app.go and plain_format.go. If we add more properties in the future, we risk diverging.
Could you try to bring back the FormatEventLine and make sure the field list lives in exactly one place, not sure if sth like this would work?

Suggested change
a.addLine(styledLine{text: styles.Success.Render(output.SuccessMarker()) + " " + msg.EmulatorName + " is running"})
if msg.Host != "" {
a.addLine(styledLine{text: "• Endpoint: " + msg.Host, secondary: true})
}
if msg.ContainerName != "" {
a.addLine(styledLine{text: "• Container: " + msg.ContainerName, secondary: true})
}
if msg.Version != "" {
a.addLine(styledLine{text: "• Version: " + msg.Version, secondary: true})
}
if msg.Uptime > 0 {
a.addLine(styledLine{text: "• Uptime: " + output.FormatUptime(msg.Uptime), secondary: true})
if line, ok := output.FormatEventLine(msg); ok {
parts := strings.Split(line, "\n")
for i, part := range parts {
if i == 0 {
part = strings.Replace(part, output.SuccessMarker(), styles.Success.Render(output.SuccessMarker()), 1)
a.addLine(styledLine{text: part})
} else {
a.addLine(styledLine{text: part, secondary: true})
}
}

Copy link
Copy Markdown
Member Author

@gtsiolis gtsiolis May 13, 2026

Choose a reason for hiding this comment

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

Added in 9a244eb, 98141b5.

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.

There's a risk with this change as it creates an implicit contract between formatInstanceInfo and the TUI: the TUI assumes line 1 of the formatted output is the header with the success marker and lines 2+ are secondary key:value bullets. Checking if this breaks anything right now... 👀

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.

still works well for me 🥳
image

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.

Thanks for checking, merging!

Co-authored-by: Anisa Oshafi <anisaoshafi@gmail.com>
@gtsiolis gtsiolis force-pushed the des-229-make-status-command-output-easier-to-read branch from 9a244eb to 98141b5 Compare May 13, 2026 12:18
Copy link
Copy Markdown
Collaborator

@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.

:shipit:

@gtsiolis gtsiolis merged commit 679d747 into main May 13, 2026
12 checks passed
@gtsiolis gtsiolis deleted the des-229-make-status-command-output-easier-to-read branch May 13, 2026 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants