Skip to content

Commit 2c5ac51

Browse files
committed
feat: upgrade fyne-charts
1 parent 063fb47 commit 2c5ac51

File tree

5 files changed

+15
-19
lines changed

5 files changed

+15
-19
lines changed

FyneApp.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Website = "https://github.com/ErikKalkoken/evebuddy"
44
Icon = "icon.png"
55
Name = "EVE Buddy"
66
ID = "io.github.erikkalkoken.evebuddy"
7-
Version = "0.52.0"
7+
Version = "0.52.1"
88
Build = 0
99

1010
[Release]

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
fyne.io/fyne/v2 v2.7.1
99
github.com/ErikKalkoken/eveauth v0.1.0
1010
github.com/ErikKalkoken/fyne-kx v0.6.4
11-
github.com/ErikKalkoken/go-set v0.2.0
11+
github.com/ErikKalkoken/go-set v0.3.0
1212
github.com/JohannesKaufmann/html-to-markdown v1.6.0
1313
github.com/PuerkitoBio/goquery v1.11.0
1414
github.com/anthonynsimon/bild v0.14.0
@@ -26,7 +26,7 @@ require (
2626
github.com/maniartech/signals v1.3.1
2727
github.com/mattn/go-sqlite3 v1.14.32
2828
github.com/microcosm-cc/bluemonday v1.0.27
29-
github.com/s-daehling/fyne-charts v0.0.0-20251223123406-e9d1bc6e925e
29+
github.com/s-daehling/fyne-charts v0.0.0-20251227165118-196292e3799e
3030
github.com/stretchr/testify v1.11.1
3131
github.com/yuin/goldmark v1.7.13
3232
golang.org/x/exp v0.0.0-20251113190631-e25ba8c21ef6

go.sum

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ github.com/ErikKalkoken/fyne-kx v0.6.4 h1:maAd3GEVaT6SeOumhnVkSNGnq/XG5xJc17mClZ
4545
github.com/ErikKalkoken/fyne-kx v0.6.4/go.mod h1:yRxTow1yH6mWQigWVE8HLl++kKHvtgy8PIucH7hOlOc=
4646
github.com/ErikKalkoken/go-set v0.2.0 h1:qbeuoupUMuwnbHzGwXTeFXXC9m/WLAPeoDakyP6rLnw=
4747
github.com/ErikKalkoken/go-set v0.2.0/go.mod h1:8hyYMuo2dqGaCGf32C/CILHMTVRJ9CV2vlcIPGOBe5I=
48+
github.com/ErikKalkoken/go-set v0.3.0 h1:yJxMD/7UfVB4+wEJ9PD0A+pODy0vreyo72szy1UcgZQ=
49+
github.com/ErikKalkoken/go-set v0.3.0/go.mod h1:8hyYMuo2dqGaCGf32C/CILHMTVRJ9CV2vlcIPGOBe5I=
4850
github.com/JohannesKaufmann/html-to-markdown v1.6.0 h1:04VXMiE50YYfCfLboJCLcgqF5x+rHJnb1ssNmqpLH/k=
4951
github.com/JohannesKaufmann/html-to-markdown v1.6.0/go.mod h1:NUI78lGg/a7vpEJTz/0uOcYMaibytE4BUOQS8k78yPQ=
5052
github.com/PuerkitoBio/goquery v1.9.2/go.mod h1:GHPCaP0ODyyxqcNoFGYlAprUFH81NuRPd0GX3Zu2Mvk=
@@ -281,6 +283,10 @@ github.com/rymdport/portal v0.4.2 h1:7jKRSemwlTyVHHrTGgQg7gmNPJs88xkbKcIL3NlcmSU
281283
github.com/rymdport/portal v0.4.2/go.mod h1:kFF4jslnJ8pD5uCi17brj/ODlfIidOxlgUDTO5ncnC4=
282284
github.com/s-daehling/fyne-charts v0.0.0-20251223123406-e9d1bc6e925e h1:WEoJbRceextSbiiMQvoN6mkEiJ9GDLNqm6jckPxBzJA=
283285
github.com/s-daehling/fyne-charts v0.0.0-20251223123406-e9d1bc6e925e/go.mod h1:2Rqw/+P+IlFt/+KmHQYTfPK8qqTkvafhXiN8pg5MTIg=
286+
github.com/s-daehling/fyne-charts v0.0.0-20251226130856-a9897318c5b6 h1:dbNhNdu8oauDarC8poWAD+XLbecH7+sHU5ydduFznBg=
287+
github.com/s-daehling/fyne-charts v0.0.0-20251226130856-a9897318c5b6/go.mod h1:2Rqw/+P+IlFt/+KmHQYTfPK8qqTkvafhXiN8pg5MTIg=
288+
github.com/s-daehling/fyne-charts v0.0.0-20251227165118-196292e3799e h1:N6JG18Nfb07YMwpQEseD9JWjx/JUAs79NgPC1pF5izc=
289+
github.com/s-daehling/fyne-charts v0.0.0-20251227165118-196292e3799e/go.mod h1:2Rqw/+P+IlFt/+KmHQYTfPK8qqTkvafhXiN8pg5MTIg=
284290
github.com/sebdah/goldie/v2 v2.5.3 h1:9ES/mNN+HNUbNWpVAlrzuZ7jE+Nrczbj8uFRjM7624Y=
285291
github.com/sebdah/goldie/v2 v2.5.3/go.mod h1:oZ9fp0+se1eapSRjfYbsV/0Hqhbuu3bJVvKI/NNtssI=
286292
github.com/segmentio/asm v1.2.1 h1:DTNbBqs57ioxAD4PrArqftgypG4/qNpXoJx8TVXxPR0=

internal/app/ui/wealth.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -437,19 +437,14 @@ func (w *colorWheel) next() color.Color {
437437
// w.n = 0
438438
// }
439439

440-
// TruncateWithSuffix shortens a string to exactly 'limit' length.
441-
// It keeps a prefix, adds "...", and ends with 'suffixLen' characters.
440+
// TruncateWithSuffix shortens a string to length limit.
441+
// It adds "..." and keeps 'suffixLen' characters at the end.
442442
func TruncateWithSuffix(s string, limit int, suffixLen int) string {
443443
runes := []rune(strings.TrimRight(s, " "))
444444
if len(runes) <= limit {
445445
return string(runes)
446446
}
447-
448-
prefixLen := limit - 3 - suffixLen
449-
if prefixLen < 0 {
450-
prefixLen = 0 // Fallback if limit is very small
451-
}
452-
447+
prefixLen := max(limit-1-suffixLen, 0) // ellipsis counts as 1
453448
prefix := runes[:prefixLen]
454449
suffix := runes[len(runes)-suffixLen:]
455450
strSuffix := strings.TrimRight(string(suffix), " ")

internal/app/ui/wealth_internal_test.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func TestTruncateWithSuffix(t *testing.T) {
136136
input: "november",
137137
limit: 7,
138138
suffixLen: 1,
139-
expected: "nov...r",
139+
expected: "novem...r",
140140
},
141141
{
142142
name: "Trailing space removal",
@@ -149,8 +149,8 @@ func TestTruncateWithSuffix(t *testing.T) {
149149
name: "Suffix ends in space",
150150
input: "open space ",
151151
limit: 9,
152-
suffixLen: 2, // "e "
153-
expected: "open...ce", // Space trimmed
152+
suffixLen: 2, // "e "
153+
expected: "open s...ce", // Space trimmed
154154
},
155155
{
156156
name: "String within limit",
@@ -165,11 +165,6 @@ func TestTruncateWithSuffix(t *testing.T) {
165165
t.Run(tt.name, func(t *testing.T) {
166166
result := TruncateWithSuffix(tt.input, tt.limit, tt.suffixLen)
167167
assert.Equal(t, tt.expected, result)
168-
169-
// Verify length constraint (unless it was shorter than limit)
170-
if len([]rune(tt.input)) > tt.limit {
171-
assert.LessOrEqual(t, len(result), tt.limit)
172-
}
173168
})
174169
}
175170
}

0 commit comments

Comments
 (0)