Skip to content

Add configurable custom metrics card layouts#39

Open
noponoponopo wants to merge 1 commit into
runcat-dev:mainfrom
noponoponopo:feat/custom-metrics-content-layout
Open

Add configurable custom metrics card layouts#39
noponoponopo wants to merge 1 commit into
runcat-dev:mainfrom
noponoponopo:feat/custom-metrics-content-layout

Conversation

@noponoponopo

Copy link
Copy Markdown

Context of Contribution

  • Bug Fix
  • Refactoring
  • New Feature
  • Others

Summary of the Proposal

This pull request adds an optional contentLayout field to Custom Metrics snapshots.

Two layouts are available:

  • indented keeps the card body to the right of the icon.
  • compact allows the card body to use the space below the icon.

The default is indented, which preserves the existing layout for snapshots that do not specify the field.

All 136 tests pass.

Reason for the new feature

Cards with several rows or longer values can use the available horizontal space more effectively when their body is allowed to extend below the icon.

The compact layout is useful for dense metrics, while the indented layout remains available for the existing visual structure.

The maintenance cost is limited to one optional enum and two small SwiftUI layout variants. Existing JSON files do not require migration.

Checklist

  • I have read the CONTRIBUTING.md and agree to follow it.
  • This PR does not contain commits of multiple contexts.
  • Code follows proper indentation and naming conventions.
  • Implemented using only APIs that can be submitted to the App Store.

Signed-off-by: nopo <dev@nopo1.com>
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