<#960 Fix for tagging nodes throwing a 500 error a...
# osctrl
g
#960 Fix for tagging nodes throwing a 500 error and updated default logo for tags Pull request opened by javuto Summary Fixes the tagging system so tagging nodes no longer throws errors, and replaces all Font Awesome icon references with lucide icon names. Problem 1. Tagging error —
TagNode
returned an error when a node was already tagged with the given tag. The handler returned this as a 500, causing batch-tagging to report failures for any already-tagged nodes. Even single-node tagging from the detail page showed "error tagging node" if the tag was already assigned. 2. Font Awesome icons — backend default icon constants (
DefaultTagIcon
,
DefaultEnvironmentIcon
) and frontend defaults used legacy Font Awesome class strings (
"fas fa-tag"
,
"fas fa-wrench"
). The SPA uses lucide-react, not Font Awesome, so these strings needed the
resolveEnvIcon
shim to work and were inconsistent with the icon picker which uses plain lucide names. Changes Tagging fix (
pkg/tags/tags.go
) •
TagNode
now returns
nil
when a node is already tagged instead of
fmt.Errorf("node already tagged")
. Tagging is idempotent — the frontend can batch-tag all selected nodes without checking which are already tagged. Icon constants (
pkg/tags/tags.go
,
pkg/environments/environments.go
) • `DefaultTagIcon`:
"fas fa-tag"
→
"tag"
• `DefaultEnvironmentIcon`:
"fas fa-wrench"
→
"wrench"
Frontend icons (
frontend/src/features/tags/TagsPage.tsx
) • `DEFAULT_ICON`:
'fas fa-tag'
→
'tag'
• Help text: "Font Awesome class (e.g.
fas fa-server
)" → "Icon name (e.g.
server
,
tag
,
wrench
)" Test files (6 files) • Updated all test fixtures from FA classes (
'fas fa-tag'
,
'fas fa-wrench'
,
'fas fa-server'
) to lucide names (
'tag'
,
'wrench'
,
'server'
) Backward compatibility The `IconPicker`'s
resolveEnvIcon
function already handles both formats — it splits on space and uses the last segment. Existing DB rows with
"fas fa-tag"
still render correctly; only new defaults use lucide names. Validation •
go build ./...
— clean •
go test ./...
— all packages pass •
npm run check
— TypeScript typecheck clean •
npm test
— 34 test files / 209 tests pass jmpsec/osctrl