Skip to content

Unified Cylinders card on dive details#492

Merged
ericgriffin merged 8 commits into
mainfrom
worktree-cylinders-card
Jul 6, 2026
Merged

Unified Cylinders card on dive details#492
ericgriffin merged 8 commits into
mainfrom
worktree-cylinders-card

Conversation

@ericgriffin

@ericgriffin ericgriffin commented Jul 5, 2026

Copy link
Copy Markdown
Member

Summary

Merges the dive detail page's two overlapping cards — Tanks (always shown) and SAC by Cylinder (multi-tank only, buried in the SAC-segments area) — into one always-expanded Cylinders card. Both cards described the same physical cylinders keyed by the same tank IDs; the section metadata already promised "per-tank SAC" on the Tanks section but the implementation never delivered it.

Each cylinder row now shows: tank name + gas mix, volume/preset chip, start/end pressures with amount used, MOD/MND, per-tank SAC with gas consumed, and source-attribution badge on multi-source dives. Per-tank SAC now appears whenever computable, including single-tank dives (previously multi-tank only).

Design spec: docs/superpowers/specs/2026-07-05-cylinders-card-design.md
Implementation plan: docs/superpowers/plans/2026-07-05-cylinders-card.md

Changes

  • New CylindersCard widget (lib/features/dive_log/presentation/widgets/cylinders_card.dart) joining dive.tanks with cylinderSacProvider results by tank ID; settings/sacUnit injected via constructor so tests need no SettingsNotifier mock
  • Occupies the existing DiveDetailSectionId.tanks slot — enum value unchanged, so saved section order/visibility configs need no migration; section label renamed to "Cylinders" (English only; all 10 other locales already used their cylinder/bottle word)
  • Removed from dive_detail_page.dart: _buildTanksSection, _buildCylinderSacSection, _formatCylinderSac, _resolveTankPressures, and the cylinder-SAC sub-block + fallback in the SAC-segments section (net -307 lines)
  • Deleted dead cylinder_sac_card.dart (never referenced) and cylinderSacExpandedProvider
  • Removed obsolete l10n keys (diveLog_detail_section_sacByCylinder, diveLog_detail_section_tanks, diveLog_detail_tankCount) from all 11 locales; profile legend now uses the new diveLog_detail_section_cylinders key
  • 8 new widget tests covering single/multi-tank, SAC-unavailable, L/min vs pressure/min, imperial units, and badge visibility

Test Plan

  • flutter test passes (134 tests across affected suites)
  • flutter analyze passes
  • Manual testing on: macOS

@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Unifies dive-detail cylinder information by replacing the separate Tanks card and the SAC by Cylinder subsection with a single always-expanded Cylinders card, while preserving the persisted section ID (DiveDetailSectionId.tanks) to avoid migrations.

Changes:

  • Added a new CylindersCard widget that joins tanks with per-tank SAC results and optional multi-source attribution.
  • Rewired the dive detail page to render CylindersCard in the existing tanks slot and removed the legacy tanks/SAC-by-cylinder builders and related expanded-state provider.
  • Updated l10n keys across all locales (added ..._cylinders, removed obsolete tanks/SAC-by-cylinder keys) and adjusted/added widget tests accordingly.

Reviewed changes

Copilot reviewed 34 out of 34 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/features/settings/presentation/pages/dive_detail_sections_page_test.dart Updates section-title expectation from “Tanks” to “Cylinders”.
test/features/dive_log/presentation/widgets/dive_profile_legend_test.dart Updates legend UI test expectation to “Cylinders”.
test/features/dive_log/presentation/widgets/cylinders_card_test.dart Adds focused widget tests for the new Cylinders card behavior/formatting.
test/core/constants/dive_detail_sections_test.dart Updates section metadata expectations (display name + SAC segments description + tanks description).
lib/l10n/arb/app_ar.arb Replaces removed tanks/SAC-by-cylinder keys with ..._cylinders and trims SAC-segments description.
lib/l10n/arb/app_de.arb Same l10n key updates for German.
lib/l10n/arb/app_en.arb Same l10n key updates for English (including metadata cleanup).
lib/l10n/arb/app_es.arb Same l10n key updates for Spanish.
lib/l10n/arb/app_fr.arb Same l10n key updates for French.
lib/l10n/arb/app_he.arb Same l10n key updates for Hebrew.
lib/l10n/arb/app_hu.arb Same l10n key updates for Hungarian.
lib/l10n/arb/app_it.arb Same l10n key updates for Italian.
lib/l10n/arb/app_nl.arb Same l10n key updates for Dutch.
lib/l10n/arb/app_pt.arb Same l10n key updates for Portuguese.
lib/l10n/arb/app_zh.arb Same l10n key updates for Chinese.
lib/l10n/arb/app_localizations.dart Regenerated localization interface: removes obsolete getters and adds diveLog_detail_section_cylinders.
lib/l10n/arb/app_localizations_ar.dart Regenerated locale implementation reflecting removed/added keys.
lib/l10n/arb/app_localizations_de.dart Regenerated locale implementation reflecting removed/added keys.
lib/l10n/arb/app_localizations_en.dart Regenerated locale implementation reflecting removed/added keys.
lib/l10n/arb/app_localizations_es.dart Regenerated locale implementation reflecting removed/added keys.
lib/l10n/arb/app_localizations_fr.dart Regenerated locale implementation reflecting removed/added keys.
lib/l10n/arb/app_localizations_he.dart Regenerated locale implementation reflecting removed/added keys.
lib/l10n/arb/app_localizations_hu.dart Regenerated locale implementation reflecting removed/added keys.
lib/l10n/arb/app_localizations_it.dart Regenerated locale implementation reflecting removed/added keys.
lib/l10n/arb/app_localizations_nl.dart Regenerated locale implementation reflecting removed/added keys.
lib/l10n/arb/app_localizations_pt.dart Regenerated locale implementation reflecting removed/added keys.
lib/l10n/arb/app_localizations_zh.dart Regenerated locale implementation reflecting removed/added keys.
lib/features/dive_log/presentation/widgets/dive_profile_legend.dart Switches the legend section title to the new cylinders l10n key.
lib/features/dive_log/presentation/widgets/cylinders_card.dart Introduces the unified Cylinders card UI (pressures, MOD/MND, per-tank SAC, attribution).
lib/features/dive_log/presentation/widgets/cylinder_sac_card.dart Removes dead/unused legacy cylinder SAC card widget code.
lib/features/dive_log/presentation/providers/gas_analysis_providers.dart Removes obsolete cylinderSacExpandedProvider.
lib/features/dive_log/presentation/pages/dive_detail_page.dart Replaces tanks section rendering with CylindersCard and deletes legacy section builders/subsections.
lib/core/constants/dive_detail_sections.dart Updates English fallback display name/description strings for tanks and SAC segments.
docs/superpowers/plans/2026-07-05-cylinders-card.md Adds implementation plan documentation for the unified Cylinders card work.

Copilot AI review requested due to automatic review settings July 5, 2026 21:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread lib/features/dive_log/presentation/widgets/cylinders_card.dart Outdated
@ericgriffin ericgriffin self-assigned this Jul 6, 2026
@ericgriffin ericgriffin moved this from Backlog to In review in Submersion Release Tracker Jul 6, 2026
@ericgriffin ericgriffin merged commit 1c59f88 into main Jul 6, 2026
19 checks passed
@ericgriffin ericgriffin deleted the worktree-cylinders-card branch July 6, 2026 04:55
@github-project-automation github-project-automation Bot moved this from In review to Done in Submersion Release Tracker Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants