This document defines how we name SwiftUI views and how we place files in the project so the codebase matches the product language and the UI hierarchy.
Views/Meter/Tabs/Home/, not in Connection/.MeterHomeTabView.swift is the root view for the meter Home tab.MeterOverviewSectionView.swift contains MeterOverviewSectionView.Home in code instead of older terms like Connection.Components/ only for reusable building blocks.
MeterInfoCardView and MeterInfoRowView.Subviews/ for views that belong to a single parent feature.
Views/Meter/Tabs/Home/Subviews/MeterOverviewSectionView.swift.Sheets/ for modal flows presented from another screen.
Views/Meter/Sheets/AppHistory/AppHistorySheetView.swift.Views/Meter/Components/.Views/Components/ unless it is truly generic.MeterNameEditorView over EditNameView.MeterConnectionActionView over ConnectionPrimaryActionView.Home/Subviews/ is better than Connection/Components/ when the views are single-use parts of the Home tab.Before adding or renaming a file, check:
Components/?Subviews/ folder?Use this structure for Meter tab work:
Views/Meter/
Components/
MeasurementChartView.swift
MeterInfoCardView.swift
MeterInfoRowView.swift
Sheets/
AppHistory/
AppHistorySheetView.swift
Subviews/
AppHistorySampleView.swift
ChargeRecord/
ChargeRecordSheetView.swift
Subviews/
ChargeRecordMetricsTableView.swift
DataGroups/
DataGroupsSheetView.swift
Subviews/
DataGroupRowView.swift
Tabs/
Home/
MeterHomeTabView.swift
Subviews/
MeterConnectionActionView.swift
MeterConnectionStatusBadgeView.swift
MeterOverviewSectionView.swift
Live/
MeterLiveTabView.swift
Subviews/
LoadResistanceIconView.swift
MeterLiveContentView.swift
MeterLiveMetricRange.swift
Chart/
MeterChartTabView.swift
Settings/
MeterSettingsTabView.swift
Subviews/
MeterCurrentScreenSummaryView.swift
MeterNameEditorView.swift
MeterScreenControlButtonView.swift
MeterScreenControlsView.swift
ScreenBrightnessEditorView.swift
ScreenTimeoutEditorView.swift
Connection/ -> Home/MeterConnectionTabView -> MeterHomeTabViewConnectionHomeInfoPreviewView -> MeterOverviewSectionViewConnectionPrimaryActionView -> MeterConnectionActionViewEditNameView -> MeterNameEditorViewMeasurementsView -> AppHistorySheetViewRecordingView -> ChargeRecordSheetViewControlView -> MeterScreenControlsViewIf a new name makes a teammate look in the right folder on the first try, it is probably a good name.