Skip to content

Commit 190582f

Browse files
authored
Enhance status icon with help text
Add help text for status icon based on upgrade availability.
1 parent 01af0ab commit 190582f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Sources/BrewFeatureInstalled/Views/InstalledListRowView.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ struct InstalledListRowView: View {
9696
.font(.body)
9797
.foregroundStyle(statusIconColor(viewModel: viewModel))
9898
.accessibilityHidden(true)
99+
.help(statusIconHelp(viewModel: viewModel))
99100

100101
Text(viewModel.kind.chrome.badgeLabel)
101102
.font(.brewCaption2)
@@ -123,6 +124,10 @@ struct InstalledListRowView: View {
123124
viewModel.showsUpgradeAvailable ? .brewStatusWarning : .brewStatusSuccess
124125
}
125126

127+
private func statusIconHelp(viewModel: InstalledListRowViewModel) -> String {
128+
viewModel.showsUpgradeAvailable ? "An upgrade is available" : "Up to date"
129+
}
130+
126131
@ViewBuilder
127132
private func versionLine(viewModel: InstalledListRowViewModel) -> some View {
128133
switch viewModel.versionPresentation {

0 commit comments

Comments
 (0)