Skip to content

Commit 29583e1

Browse files
Use embedded data URIs for Octicon icons
- Embed SVG icons using go:embed for offline use and faster loading - Convert icons to base64 data URIs at runtime - Fall back to CDN URL for non-embedded icons - Add test to verify all toolset icons are properly embedded - 44 SVG files (22 icons × 2 sizes) totaling ~27KB
1 parent 1759119 commit 29583e1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+117
-68
lines changed

pkg/github/tools.go

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -362,38 +362,6 @@ func AddDefaultToolset(result []string) []string {
362362
return result
363363
}
364364

365-
// cleanToolsets cleans and handles special toolset keywords:
366-
// - Duplicates are removed from the result
367-
// - Removes whitespaces
368-
// - Validates toolset names and returns invalid ones separately - for warning reporting
369-
// Returns: (toolsets, invalidToolsets)
370-
func CleanToolsets(enabledToolsets []string) ([]string, []string) {
371-
seen := make(map[string]bool)
372-
result := make([]string, 0, len(enabledToolsets))
373-
invalid := make([]string, 0)
374-
r := NewRegistry(translations.NullTranslationHelper).Build()
375-
376-
// Add non-default toolsets, removing duplicates and trimming whitespace
377-
for _, toolset := range enabledToolsets {
378-
trimmed := strings.TrimSpace(toolset)
379-
if trimmed == "" {
380-
continue
381-
}
382-
if !seen[trimmed] {
383-
seen[trimmed] = true
384-
result = append(result, trimmed)
385-
// Check if it's a valid toolset (special keywords "all" and "default" are valid)
386-
if !r.HasToolset(registry.ToolsetID(trimmed)) &&
387-
trimmed != string(ToolsetMetadataAll.ID) &&
388-
trimmed != string(ToolsetMetadataDefault.ID) {
389-
invalid = append(invalid, trimmed)
390-
}
391-
}
392-
}
393-
394-
return result, invalid
395-
}
396-
397365
func RemoveToolset(tools []string, toRemove string) []string {
398366
result := make([]string, 0, len(tools))
399367
for _, tool := range tools {

pkg/octicons/icons/apps-16.svg

Lines changed: 1 addition & 0 deletions
Loading

pkg/octicons/icons/apps-24.svg

Lines changed: 1 addition & 0 deletions
Loading

pkg/octicons/icons/beaker-16.svg

Lines changed: 1 addition & 0 deletions
Loading

pkg/octicons/icons/beaker-24.svg

Lines changed: 1 addition & 0 deletions
Loading

pkg/octicons/icons/bell-16.svg

Lines changed: 1 addition & 0 deletions
Loading

pkg/octicons/icons/bell-24.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

pkg/octicons/icons/codescan-16.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)