Skip to content

🛜 feat: Add special TE count display for unset state#1924

Merged
mkmccarty merged 1 commit intomainfrom
mm-branch-1
Dec 10, 2025
Merged

🛜 feat: Add special TE count display for unset state#1924
mkmccarty merged 1 commit intomainfrom
mm-branch-1

Conversation

@mkmccarty
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings December 10, 2025 03:12
@mkmccarty mkmccarty merged commit 3b0da91 into main Dec 10, 2025
8 of 12 checks passed
@mkmccarty mkmccarty deleted the mm-branch-1 branch December 10, 2025 03:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a visual indicator (🛜 emoji) to display when Truth Egg (TE) count data is being fetched asynchronously from the API, improving the user experience by showing a loading state instead of displaying 0 or no value.

Key Changes:

  • Introduced -1 as a sentinel value to indicate TE count is being fetched
  • Added conditional display logic to show 🛜 emoji when TECount == -1
  • Applied the display logic consistently across three different rendering contexts

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/boost/boost.go Initialize TECount to -1 when starting asynchronous fetch, serving as a sentinel value for "loading" state
src/boost/boost_draw.go Add conditional rendering logic in three locations to display 🛜 emoji for unset TE count (-1) instead of showing the numeric value

Comment thread src/boost/boost_draw.go
Comment on lines +309 to +313
if b.TECount == -1 {
sortRate = fmt.Sprint(" **TE:🛜** ")
} else {
sortRate = fmt.Sprintf(" **TE:%d** ", b.TECount)
}
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

This logic for handling TECount == -1 is duplicated in three locations (lines 309-313, 356-360, and 440-444). Consider extracting this into a helper function to reduce code duplication and improve maintainability.

For example:

func getTESortRate(teCount int) string {
    if teCount == -1 {
        return fmt.Sprint(" **TE:🛜** ")
    }
    return fmt.Sprintf(" **TE:%d** ", teCount)
}

Copilot uses AI. Check for mistakes.
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.

2 participants