Skip to content

feat: align memory metric naming with implementation semantics (issue #33)#43

Merged
ShadyUnderLight merged 2 commits intomainfrom
feature/issue33-memory-pressure-naming
Apr 21, 2026
Merged

feat: align memory metric naming with implementation semantics (issue #33)#43
ShadyUnderLight merged 2 commits intomainfrom
feature/issue33-memory-pressure-naming

Conversation

@ShadyUnderLight
Copy link
Copy Markdown
Owner

@ShadyUnderLight ShadyUnderLight commented Apr 21, 2026

Summary

Renames the memory UI copy from "used / total memory" to "Memory pressure" to accurately reflect the actual metric (system-wide active + inactive + wired + compressor pages), reducing product-semantic ambiguity raised in issue #33.

Changes

Views.swift

  • memorySummary now displays the pressure percentage (e.g. "72%") instead of used/total bytes
  • SummaryCardView gains an optional subtitle parameter; RAM card shows "72%" as the primary value with "8 GB / 16 GB" as a secondary caption

MonitorViewModel.swift

  • menuBarTitle now uses memoryPressurePercent for all three display modes (compact / labeled / temperatureFirst) instead of shortMemoryString(bytes:); fully aligned with the popup semantic model

en.lproj Localizable.strings

  • summary.ram: "RAM (System-wide)" -> "Memory pressure"
  • metric.used_percent -> metric.memory_pressure: "%.0f%%"
  • menu_bar_title.labeled: "CPU %@ RAM %@ %@" -> "CPU %@ Mem %@ %@"
  • health.line: "CPU %@ · RAM %@ · Temp %@" -> "CPU %@ · Mem %@ · Temp %@"
  • trend.ram: "RAM Trend" -> "Memory pressure"

zh-Hans.lproj Localizable.strings

  • summary.ram: "内存 (系统级)" -> "内存压力"
  • metric.used_percent -> metric.memory_pressure: "%.0f%%"
  • trend.ram: "内存趋势" -> "内存压力"

README.md / README.zh-CN.md

  • "Memory used / total memory" -> "Memory pressure (system-wide active + inactive + wired + compressor)"

Consistent memory pressure semantics across ALL UI surfaces

Surface Memory value shown Semantic
Summary card primary "72%" memory pressure %
Summary card subtitle "8 GB / 16 GB" byte detail (secondary)
Menu bar compact "50% 72% 65°" CPU · Mem · Temp
Menu bar labeled "CPU 50% Mem 72% 65°" pressure %
Menu bar temperature_first "65° CPU 50% Mem 72%" pressure %

All 104 tests pass.

LMZ added 2 commits April 21, 2026 18:11
TemperatureParsingTests: 17 tests covering extractTemperature boundaries
  (valid range 1-120°C), invalid inputs, and multiple-number handling.

EnumSavedValueTests: 18 tests for TemperatureMode and MenuBarDisplayMode
  savedValue initializers — both modern rawValue strings and legacy
  display-name strings (e.g. 'Hottest CPU').

LocalizationTests: 15 tests for L10n localizationCandidates fallback chain
  across en-*/zh-*/fr-/ja-JP locales, deduplication, and edge cases.

DiagnosticsTests: 17 tests for ProcessSnapshotDiagnostics state machine
  (markAttempt / markSuccess / markFailure) and full lifecycle transitions.

MonitorViewModelTests: 15 tests for ViewModel defaults, legacy settings
  migration (temperatureMode + menuBarDisplayMode), and fallbacks.

TestExpose.swift: test-only L10n wrapper exposing localizationCandidates
  to the test target.

Source changes:
- Localization.swift: make localizationCandidates internal (was private)
- SystemMetricsProvider.swift: add nonisolated extractTemperatureTest
…33)

Rename memory UI copy to 'Memory pressure' to accurately reflect the
system-wide active+inactive+wired+compressor metric rather than
implying a simple used/total partition.

Changes:
- Views.swift: memorySummary now shows pressure % instead of used/total bytes;
  SummaryCardView gains optional subtitle parameter to show bytes detail;
  RAM card displays 'XX%' with 'X GB / Y GB' as subtitle
- MonitorViewModel.swift: menuBarTitle now uses memoryPressurePercent for
  all three display modes (compact/labeled/temperatureFirst) instead of
  shortMemoryString(bytes:); aligned with popup semantic model
- en.lproj: summary.ram 'RAM (System-wide)' -> 'Memory pressure';
  metric.used_percent -> metric.memory_pressure '%.0f%%';
  menu_bar_title.labeled 'CPU %@  RAM %@  %@' -> 'CPU %@  Mem %@  %@';
  health.line 'RAM' -> 'Mem'; trend.ram -> 'Memory pressure'
- zh-Hans.lproj: summary.ram '内存 (系统级)' -> '内存压力';
  metric.used_percent -> metric.memory_pressure '%.0f%%';
  trend.ram -> '内存压力'
- README.md / README.zh-CN.md: 'Memory used / total memory' now reads
  'Memory pressure (system-wide active + inactive + wired + compressor)'

Consistent memory pressure semantics across all UI surfaces:
- Summary card: '72%' primary + '8 GB / 16 GB' subtitle
- Menu bar compact: '50%  72%  65°' (CPU · Mem · Temp)
- Menu bar labeled: 'CPU 50%  Mem 72%  65°'
- Menu bar temperature_first: '65°  CPU 50%  Mem 72%'
@ShadyUnderLight ShadyUnderLight force-pushed the feature/issue33-memory-pressure-naming branch from 2dff129 to 951d702 Compare April 21, 2026 10:35
@ShadyUnderLight ShadyUnderLight merged commit cd76c88 into main Apr 21, 2026
2 checks passed
@ShadyUnderLight ShadyUnderLight deleted the feature/issue33-memory-pressure-naming branch April 21, 2026 10:40
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