Skip to content

Commit 8639f44

Browse files
akoclaude
andcommitted
fix: sort SHOW FEATURES output alphabetically by display name
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 50b1e79 commit 8639f44

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

sdk/versions/registry.go

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ func (r *Registry) IsAvailable(area, name string, projectVersion SemVer) bool {
231231
}
232232

233233
// FeaturesForVersion returns all features and their availability status for a
234-
// given project version. Results are sorted by area, then name.
234+
// given project version. Results are sorted alphabetically by display name.
235235
func (r *Registry) FeaturesForVersion(projectVersion SemVer) []FeatureStatus {
236236
var result []FeatureStatus
237237
seen := make(map[string]bool)
@@ -262,10 +262,7 @@ func (r *Registry) FeaturesForVersion(projectVersion SemVer) []FeatureStatus {
262262
}
263263

264264
sort.Slice(result, func(i, j int) bool {
265-
if result[i].Area != result[j].Area {
266-
return result[i].Area < result[j].Area
267-
}
268-
return result[i].Name < result[j].Name
265+
return result[i].DisplayName() < result[j].DisplayName()
269266
})
270267

271268
return result
@@ -296,13 +293,7 @@ func (r *Registry) FeaturesAddedSince(sinceVersion SemVer) []FeatureEntry {
296293
}
297294

298295
sort.Slice(result, func(i, j int) bool {
299-
if result[i].MinVersion.String() != result[j].MinVersion.String() {
300-
return result[j].MinVersion.AtLeast(result[i].MinVersion)
301-
}
302-
if result[i].Area != result[j].Area {
303-
return result[i].Area < result[j].Area
304-
}
305-
return result[i].Name < result[j].Name
296+
return result[i].DisplayName() < result[j].DisplayName()
306297
})
307298

308299
return result
@@ -341,7 +332,7 @@ func (r *Registry) FeaturesInArea(area string, projectVersion SemVer) []FeatureS
341332
}
342333

343334
sort.Slice(result, func(i, j int) bool {
344-
return result[i].Name < result[j].Name
335+
return result[i].DisplayName() < result[j].DisplayName()
345336
})
346337

347338
return result

0 commit comments

Comments
 (0)