Skip to content

desktop: vertically center dashboard Tasks/Goals rows#6906

Merged
kodjima33 merged 3 commits intomainfrom
fix/dashboard-cards-vcenter
Apr 20, 2026
Merged

desktop: vertically center dashboard Tasks/Goals rows#6906
kodjima33 merged 3 commits intomainfrom
fix/dashboard-cards-vcenter

Conversation

@kodjima33
Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #6903. With the cards now equalized to the taller intrinsic height, the shorter card's rows pinned to the top, leaving a visible gap below. This PR centers the rows vertically inside each card so they float to the middle when the sibling card is taller.

Wraps the existing row VStack in VStack(spacing: 0) { Spacer(minLength: 0); … ; Spacer(minLength: 0) }.frame(maxHeight: .infinity) for both empty and non-empty branches in TasksWidget and GoalsWidget.

Test plan

  • Dashboard with 2 tasks and 4 goals — Tasks rows centered vertically; Goals fills.
  • Dashboard with 4 tasks and 1 goal — Goals row centered; Tasks fills.
  • Empty state on either side — empty content stays centered.

🤖 Generated with Claude Code

kodjima33 and others added 3 commits April 20, 2026 19:55
When the Goals card determines the row height (more goals than
tasks), the Tasks card's rows now float to the middle of the cell
instead of pinning to the top, matching the visual balance the user
asked for.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mirror of the TasksWidget change so the Goals card behaves the same
way when the Tasks card determines the row height.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@kodjima33 kodjima33 merged commit bc4ffd3 into main Apr 20, 2026
1 check passed
@kodjima33 kodjima33 deleted the fix/dashboard-cards-vcenter branch April 20, 2026 23:56
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 20, 2026

Greptile Summary

This PR vertically centers the content rows inside the TasksWidget and GoalsWidget dashboard cards by wrapping each branch's content in a Spacer(minLength: 0) … Spacer(minLength: 0) sandwich with .frame(maxHeight: .infinity). This ensures that when one card is shorter than its sibling (whose height sets the row), the shorter card's rows float to the middle rather than pinning to the top.

Confidence Score: 5/5

Safe to merge — small, self-contained layout-only change with no logic or data mutations.

All changes are purely layout adjustments using a standard SwiftUI vertical-centering pattern. No logic, state, or data handling is modified, and both the empty and populated branches are handled consistently in both widgets.

No files require special attention.

Important Files Changed

Filename Overview
desktop/Desktop/Sources/MainWindow/Components/TodaysTasksWidget.swift Wraps both the empty-state and non-empty-state content in a Spacer-sandwich VStack with maxHeight: .infinity to vertically center rows when the sibling card is taller
desktop/Desktop/Sources/MainWindow/Components/GoalsWidget.swift Applies the same Spacer-sandwich centering pattern as TodaysTasksWidget to both the empty state (AI generation button) and the populated goals list
desktop/CHANGELOG.json Adds a new "unreleased" entry describing the vertical centering change; no issues found

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Dashboard Row] --> B[TasksWidget]
    A --> C[GoalsWidget]

    B --> B1{totalTaskCount == 0?}
    B1 -- Yes --> B2["VStack(spacing:0)\n  Spacer(minLength:0)\n  Empty state icon+label\n  Spacer(minLength:0)\n.frame(maxHeight:.infinity)"]
    B1 -- No --> B3["VStack(spacing:0)\n  Spacer(minLength:0)\n  Task rows (prefix 3)\n  'View all' button\n  Spacer(minLength:0)\n.frame(maxHeight:.infinity)"]

    C --> C1{goals.isEmpty?}
    C1 -- Yes --> C2["VStack(spacing:0)\n  Spacer(minLength:0)\n  AI Generate button\n  Spacer(minLength:0)\n.frame(maxHeight:.infinity)"]
    C1 -- No --> C3["VStack(spacing:0)\n  Spacer(minLength:0)\n  GoalRowView list\n  Spacer(minLength:0)\n.frame(maxHeight:.infinity)"]
Loading

Reviews (1): Last reviewed commit: "desktop: changelog for vertically center..." | Re-trigger Greptile

Glucksberg pushed a commit to Glucksberg/omi-local that referenced this pull request Apr 28, 2026
…6906)

## Summary
Follow-up to BasedHardware#6903. With the cards now equalized to the taller intrinsic
height, the shorter card's rows pinned to the top, leaving a visible gap
below. This PR centers the rows vertically inside each card so they
float to the middle when the sibling card is taller.

Wraps the existing row VStack in `VStack(spacing: 0) { Spacer(minLength:
0); … ; Spacer(minLength: 0) }.frame(maxHeight: .infinity)` for both
empty and non-empty branches in `TasksWidget` and `GoalsWidget`.

## Test plan
- [ ] Dashboard with 2 tasks and 4 goals — Tasks rows centered
vertically; Goals fills.
- [ ] Dashboard with 4 tasks and 1 goal — Goals row centered; Tasks
fills.
- [ ] Empty state on either side — empty content stays centered.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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