Fix for tagging nodes throwing a 500 error and updated default logo for tags - #960
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the tagging system so tagging nodes no longer throws errors, and replaces all Font Awesome icon references with lucide icon names.
Problem
Tagging error —
TagNodereturned 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.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 theresolveEnvIconshim to work and were inconsistent with the icon picker which uses plain lucide names.Changes
Tagging fix (
pkg/tags/tags.go)TagNodenow returnsnilwhen a node is already tagged instead offmt.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'fas fa-server)" → "Icon name (e.g.server,tag,wrench)"Test files (6 files)
'fas fa-tag','fas fa-wrench','fas fa-server') to lucide names ('tag','wrench','server')Backward compatibility
The
IconPicker'sresolveEnvIconfunction 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 ./...— cleango test ./...— all packages passnpm run check— TypeScript typecheck cleannpm test— 34 test files / 209 tests pass