SIGN IN SIGN UP

calendar: Fix calendar 8-column regression introduced in 1bb129b (#2745)

The base calendar rendered all items (7 weekday headers + all date
cells) into a single `h_flex().flex_wrap()` container. With the default
calendar inner width of ~264px and items at 32px each, `⌊264÷32⌋ = 8`
items fit per row — causing the weekday header row to absorb the first
date cell and shift every subsequent date one column right.

**Fix:** Replace the flat `h_flex().flex_wrap()` month container in
`crates/base/src/calendar.rs` with a `v_flex` that renders the weekday
header as its own `h_flex` row and each calendar week as its own
`h_flex` row — making the 7-column structure layout-explicit rather than
width-dependent.

```rust
// Before
let mut month = h_flex().flex_wrap();
for weekday in 0..7 { month = month.child(weekday_item); }
for date in weeks.iter().flatten() { month = month.child(day_item); }

// After
let mut month = v_flex();
let mut header_row = h_flex();
for weekday in 0..7 { header_row = header_row.child(weekday_item); }
month = month.child(header_row);
for week in weeks.iter() {
    let mut week_row = h_flex();
    for date in week { week_row = week_row.child(day_item); }
    month = month.child(week_row);
}
```

## Screenshot

| Before | After |
| --- | --- |
| ![buggy calendar showing 8 columns with "Sa 28" on the header
row](https://github.com/user-attachments/assets/dd5aeeb7-5d0f-4bcb-b624-67da70855479)
| <img width="287" height="310" alt="image"
src="https://github.com/user-attachments/assets/f4814366-7e3b-4d84-99be-533e09abc8f3"
/> |

The "After" screenshot above shows the fixed rendering — July 1, 2026
correctly lands on Wednesday, and weekends align vertically.

## How to Test

Open the calendar story and verify:
- Weekday header row shows exactly 7 columns (Su–Sa)
- July 1, 2026 falls on Wednesday (column 4, 0-indexed from Sunday)
- Disabled weekends produce vertical stripes, not diagonal

## Checklist

- [ ] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document and
followed the guidelines.
- [ ] Reviewed the changes in this PR and confirmed AI generated code
(If any) is accurate.
- [ ] Passed `cargo run` for story tests related to the changes.
- [ ] Tested macOS, Windows and Linux platforms performance (if the
change is platform-specific)

<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes #2742

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: huacnlee <5518+huacnlee@users.noreply.github.com>
Co-authored-by: Jason Lee <huacnlee@gmail.com>
Co-authored-by: Codex <codex@openai.com>
C
Copilot committed
8c9a8f93acc2eb746eb8e24cb43dec9b97e217d8
Parent: c7f5877
Committed by GitHub <noreply@github.com> on 8/17/2026, 9:38:19 AM