feat(ios): surface shift tags on schedule and dashboard #334

Merged
owlburtoe merged 1 commit from ios-shift-tags into main 2026-06-08 11:12:19 -04:00
Owner

Summary

iOS counterpart to #330 (web) and #332 (Android). Renders shift tags (call, hot, preceptor, …) at a glance on the staff member's own shift display so they can see what type of shift they're working. A shift with no tags is a regular shift (nothing rendered).

Tags were already decoded from the generated Components.Schemas.Shift and already rendered on coworker rows (CoworkerGroupCard). This PR closes the remaining gap: the staff member's own shifts on the Schedule screen and the Dashboard next-shift hero.

No backend dependency

iOS sources shifts from the schedule-detail endpoint (GET /schedules/{id}), which already carries tags on every shift (the generated Swift types already decode them). So this is a self-contained, iOS-only change off main — it does not depend on #330's backend change.

Changes

File Change
Schedule/Models/ScheduleModels.swift Add tags: [ScheduleCoworkerTag] to ScheduleShiftSummary (defaulted init param)
Schedule/Models/ScheduleDerivation.swift Map shift.tags into the own-shift summary
Schedule/ScheduleView.swift Render tag pills (reusing existing ConfiguredPill) on ScheduleShiftTileContent — covers day, week, and selected-day surfaces
Dashboard/Models/NextShiftSummary.swift Add tags: [ScheduleCoworkerTag] (defaulted)
Dashboard/DashboardViewModel.swift Carry tags through AssignedShiftNextShiftSummary
Dashboard/Components/NextShiftHero.swift Render tag pills on the hero; resolve the stale "deferred until OpenAPI declares tags" note

Reuses the existing ConfiguredPill component and ScheduleColor-resolved colors, and the same ScheduleCoworkerTag model + shift.tags source already used for coworker tags — no new component, no new color parsing, no networking/DTO changes.

Test plan

  • xcodegen generate + xcodebuild ... -destination 'iPhone 17' test154 tests, 0 failures (TEST SUCCEEDED), incl. ScheduleDerivationTests
  • Manual: verify colored tag pills render on own shifts (schedule day/week/selected-day + dashboard next-shift hero) for tagged shifts, and nothing renders for untagged (regular) shifts; confirm coworker tags still render as before
## Summary iOS counterpart to #330 (web) and #332 (Android). Renders shift tags (`call`, `hot`, `preceptor`, …) at a glance on the staff member's **own** shift display so they can see what type of shift they're working. A shift with **no tags is a regular shift** (nothing rendered). Tags were already decoded from the generated `Components.Schemas.Shift` and already rendered on **coworker** rows (`CoworkerGroupCard`). This PR closes the remaining gap: the staff member's own shifts on the Schedule screen and the Dashboard next-shift hero. ## No backend dependency iOS sources shifts from the **schedule-detail** endpoint (`GET /schedules/{id}`), which already carries `tags` on every shift (the generated Swift types already decode them). So this is a self-contained, iOS-only change off `main` — it does **not** depend on #330's backend change. ## Changes | File | Change | |---|---| | `Schedule/Models/ScheduleModels.swift` | Add `tags: [ScheduleCoworkerTag]` to `ScheduleShiftSummary` (defaulted init param) | | `Schedule/Models/ScheduleDerivation.swift` | Map `shift.tags` into the own-shift summary | | `Schedule/ScheduleView.swift` | Render tag pills (reusing existing `ConfiguredPill`) on `ScheduleShiftTileContent` — covers day, week, and selected-day surfaces | | `Dashboard/Models/NextShiftSummary.swift` | Add `tags: [ScheduleCoworkerTag]` (defaulted) | | `Dashboard/DashboardViewModel.swift` | Carry tags through `AssignedShift` → `NextShiftSummary` | | `Dashboard/Components/NextShiftHero.swift` | Render tag pills on the hero; resolve the stale "deferred until OpenAPI declares `tags`" note | Reuses the existing `ConfiguredPill` component and `ScheduleColor`-resolved colors, and the same `ScheduleCoworkerTag` model + `shift.tags` source already used for coworker tags — no new component, no new color parsing, no networking/DTO changes. ## Test plan - [x] `xcodegen generate` + `xcodebuild ... -destination 'iPhone 17' test` — **154 tests, 0 failures (TEST SUCCEEDED)**, incl. `ScheduleDerivationTests` - [ ] Manual: verify colored tag pills render on own shifts (schedule day/week/selected-day + dashboard next-shift hero) for tagged shifts, and nothing renders for untagged (regular) shifts; confirm coworker tags still render as before
feat(ios): surface shift tags on schedule and dashboard
All checks were successful
Code Scanning / Gitleaks secret scan (pull_request) Successful in 7s
Code Scanning / Semgrep OSS source scan (pull_request) Successful in 1m10s
iOS / ShiftdKit (Linux) (pull_request) Successful in 2m40s
Android / Android Validation (pull_request) Successful in 6m55s
Security, Type Check & Runtime / Dependency Audit (pull_request) Successful in 9m49s
Security, Type Check & Runtime / Migration Guardrails (pull_request) Successful in 9m49s
Security, Type Check & Runtime / Backend Runtime Smoke (pull_request) Successful in 10m34s
Security, Type Check & Runtime / Type Check (pull_request) Successful in 10m41s
Release Artifacts / Validate release candidate (pull_request) Successful in 11m23s
E2E Tests / e2e (pull_request) Successful in 14m48s
Release Artifacts / Build and push Docker release images (pull_request) Has been skipped
Release Artifacts / Deploy to staging (pull_request) Has been skipped
9428975416
Mirror the web/Android change: render shift tags (call, hot, preceptor, …)
at a glance so any staff member can see what type of shift they're working.
No tags means a regular shift.

Tags were already decoded from the generated Shift type and rendered on
coworker rows (CoworkerGroupCard); this propagates them to the staff
member's own shift display:

- Add tags to ScheduleShiftSummary and NextShiftSummary, populated from
  shift.tags in the schedule and dashboard derivations.
- Render tag pills (reusing the existing ConfiguredPill) on the schedule
  shift tile (ScheduleShiftTileContent, used by day/week/selected-day) and
  the dashboard next-shift hero (NextShiftHero) — resolving its deferred
  "until OpenAPI declares tags" note.

No backend dependency: iOS sources shifts from schedule-detail, which
already carries tags.
owlburtoe deleted branch ios-shift-tags 2026-06-08 11:12:20 -04:00
Sign in to join this conversation.
No description provided.