updated ui for recents when fully collapsed: instead of 0/10 its 10 items

This commit is contained in:
neon443 committed 2025-08-17 18:35:45 +01:00
1 parent a6e59eec2c
commit 95fd3dfe07
1 file changed
+12 -4
+12 -4
View File
@@ -65,10 +65,14 @@ struct RecentsView: View {
.disabled(historyCount == hostsManager.history.count) .disabled(historyCount == hostsManager.history.count)
Spacer() Spacer()
Text("\(historyCount)/\(hostsManager.history.count)") Text(
.foregroundStyle(.gray) historyCount == 0 ?
.font(.caption) "\(hostsManager.history.count) item\(plural(hostsManager.history.count))" :
.contentTransition(.numericText()) "\(historyCount)/\(hostsManager.history.count)"
)
.foregroundStyle(.gray)
.font(.caption)
.contentTransition(.numericText())
Spacer() Spacer()
Button { Button {
@@ -96,3 +100,7 @@ struct RecentsView: View {
keyManager: KeyManager() keyManager: KeyManager()
) )
} }
func plural(_ num: Int) -> String {
return num == 1 ? "" : "s"
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.