Skip to content

feat: show active rotating goal in compact dock UI (#148)#162

Merged
itsmiso-ai merged 1 commit into
mainfrom
saffron/issue-148-goal-display
Jun 2, 2026
Merged

feat: show active rotating goal in compact dock UI (#148)#162
itsmiso-ai merged 1 commit into
mainfrom
saffron/issue-148-goal-display

Conversation

@itsmiso-ai
Copy link
Copy Markdown
Contributor

Fixes #148

Add GoalLabel node to the left column header between Subtitle and ResourceLabel. Wire up render_goal() in render_all() to display the current rotating goal with progress.

Formats match the spec examples:

  • Goal: Reach 10 wood
  • Goal: Build Garden (3/5)
  • Goal: Finish a build ✓

Hides when no active goal exists. Autowrap + compact font size keeps it from clipping in bottom or side dock layouts.

Acceptance criteria:

Add GoalLabel node to the left column header between Subtitle and
ResourceLabel. Wire up render_goal() in render_all() to display the
current rotating goal with progress.

Formats match the spec examples:
  Goal: Reach 10 wood
  Goal: Build Garden (3/5)
  Goal: Finish a build ✓

Hides when no active goal exists. Autowrap + compact font size keeps
it from clipping in bottom or side dock layouts.
@itsmiso-ai itsmiso-ai requested a review from joryirving as a code owner June 2, 2026 02:32
Copy link
Copy Markdown

@its-saffron its-saffron Bot left a comment

Choose a reason for hiding this comment

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

AI Automated Review

Analysis engine: MiniMax@https://litellm.jory.dev/v1 (anthropic)

Recommendation: Approve

This is a small, well-scoped implementation of the rotating-goal display for the compact dock UI. The diff is internally consistent, follows existing scene/script conventions, and matches the linked issue's examples and acceptance criteria.

Change-by-change findings

scenes/main.tscn (+8)

  • Adds a GoalLabel of type Label under Backdrop/Margin/Root/Left, placed between the existing Subtitle and ResourceLabel nodes (matches the PR description and the Left-column header pattern).
  • Uses unique_name_in_owner = true so the script can reference it via %GoalLabel, consistent with the other Left-column labels.
  • autowrap_mode = 3 (AUTOWRAP_WORD_SMART) and theme_override_font_sizes/font_size = 13 mirror the Subtitle/ResourceLabel pattern and directly address the "Bottom and side dock layouts do not clip" acceptance criterion.
  • modulate = Color(1, 1, 1, 0.75) is a touch brighter than Subtitle's 0.7, which is a reasonable visual hierarchy for an actionable hint; not a regression.

scripts/main.gd (+37)

  • Adds @onready var goal_label: Label = %GoalLabel next to the existing @onready references for the Left-column labels — consistent placement.
  • Wires render_goal() into render_all() after render_worker_overlay() and before render_sidebar(), keeping render order logical.
  • render_goal():
    • Guards is_instance_valid(goal_label) (consistent with other renderers).
    • Sets visible = false and text = "Goal: —" when active_goal.is_empty() — matches the "Hides when no active goal exists" behavior claimed in the PR.
    • Uses a match on RotatingGoal.GOAL_TYPE_* constants to format per the issue's examples:
      • GOAL_TYPE_RESOURCEGoal: Reach %d %s (e.g., Goal: Reach 5 food)
      • GOAL_TYPE_BUILDGoal: Build %s with cap(build_kind) (e.g., Goal: Build Garden)
      • GOAL_TYPE_BUILD_COMPLETEGoal: Finish a build
    • Progress is appended as (%d/%d) only when target > 0 and progress > 0 and the goal is not yet complete; complete goals get a suffix — directly addresses "Progress is shown when useful."
    • Reuses RotatingGoal.is_goal_complete(active_goal) so completion detection stays in the data model (no duplicated logic).

Linked Issue Fit (#148)

Issue AC Status
Active goal text appears in compact UI Met — render_goal() updates %GoalLabel each tick
Progress is shown when useful Met — (%d/%d) only when progress > 0, target > 0, not complete
Bottom and side dock layouts do not clip Met in code — autowrap + 13 px font; visual confirmation recommended but not blocking
Layout tests are added/updated if applicable Not added, but the existing tests/ suite does not test any other Left-column label renderers (ResourceLabel, Subtitle, StatusLabel, ActivityLabel), so a new UI test would actually be inconsistent with repo conventions. The "if applicable" qualifier is satisfied.
Link back to #131 and #135 Conceptually met — uses RotatingGoal from scripts/rotating_goal.gd, which already references misospace/windowstead#142 and #131 at line 3 of that file. The PR description also names both issues. No new code comment is strictly required.

The PR also correctly avoids the two out-of-scope items the issue called out: no reward preview (left to #141) and no large goal panel.

Standards Compliance (AGENTS.md)

  • "Bottom dock is the primary mode" — the label is added to the shared Left column used by both anchor families, so it shows in both; primary mode is unaffected.
  • "The world strip is the product" / "glanceable, low-attention" — the goal line is a single short Label, not a panel.
  • "Menus should be temporary popup overlays, not persistent sidebars" — no panel/menu added; just a label.
  • "Separate layout assumptions for bottom vs vertical mode" — the label sits in a shared VBox with autowrap, so it adapts without requiring per-anchor math.
  • No regressions against the "Avoid" list (no sidebar UI, no resized-version-of-each-other behavior, no menu-hides-world).

Evidence Provider Findings

None configured; nothing to evaluate.

Tool Harness Findings

The harness reported 0 planned requests and a planning warning (Could not parse planning response as JSON). This appears to be a harness/parse issue, not a finding against the PR — no blocker-level evidence was produced.

Unknowns / Needs Verification

  • Visual clipping in bottom vs side dock modes: the code uses the same styling approach as the other Left-column labels, but the PR was not visually validated in the corpus. A quick editor launch (per CONTRIBUTING.md's "Smoke test before pushing") would confirm no clipping, but I would not block on this since the pattern matches neighbors exactly.
  • Edge case for unknown goal_type: if active_goal["type"] is not one of the three known constants, goal_text stays empty and only the optional progress suffix is appended (or the ✓ for already-complete goals). This produces a near-empty line in an edge case that the data model should never produce. Low risk; consider a final _: branch with a defensive fallback in a follow-up.
  • No tests added: as noted above, this is consistent with the rest of the Left-column label code, so not blocking.

Sources

  • PR diff: scenes/main.tscn, scripts/main.gd
  • Linked issue: #148 (ux: show active rotating goal in compact UI)
  • Repository impact scan: confirmed RotatingGoal constants used in scripts/rotating_goal.gd and active_goal in scripts/main.gd (lines 79, 722–723, 1070–1073, 1547+)
  • Repository history: HEAD commit cd9f623 matches PR title; previous goal-related work is #142 (data model) and #145 (rotation), both already merged
  • Standards: AGENTS.md (UX constraints, validation, bottom-dock-first polish)

@itsmiso-ai itsmiso-ai merged commit 372e9e3 into main Jun 2, 2026
4 checks passed
@itsmiso-ai itsmiso-ai deleted the saffron/issue-148-goal-display branch June 2, 2026 09:53
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.

ux: show active rotating goal in compact UI

1 participant