Skip to content

Add configurable tag style rules - #1640

Open
killecaptron wants to merge 1 commit into
Part-DB:masterfrom
killecaptron:tag-styles
Open

killecaptron wants to merge 1 commit into
Part-DB:masterfrom
killecaptron:tag-styles

Conversation

@killecaptron

Copy link
Copy Markdown
Contributor

Tags are a free-form, flat list, and every tag looks the same, so a list of parts with a dozen tags per row
gives no visual grouping at all - even though tags are usually used in namespaces like Risk:High or
Project:Foo.

An administrator can now define an ordered list of rules under System settings → Tag styles, which map a tag
(exactly, or by prefix) to one of the semantic Bootstrap colors. Tags which do not match any rule keep their
previous appearance, and only the color of a tag changes - filtering and searching by tags are untouched.

At most one rule is applied per tag: an exact rule wins over a prefix rule, the longest matching prefix wins
among prefix rules, and the first configured rule wins any remaining tie. The rules are resolved in one place,
so tags look the same in the part tables and on the part page.

Each rule row previews itself while it is edited. The rules only take effect once the settings are saved, so a
row which showed a fixed word in the stored color gave no feedback about what is being typed: the badge now
shows the entered tag in the chosen color, a prefix rule marks itself with an ellipsis, and the badge explains
what the selected match type will match. That is also the answer to "exact or prefix?", which the two words
alone do not explain.

Documented in docs/usage/tag_styles.md.

🤖 Generated with Claude Code

Tags are a free-form, flat list, and every tag looked the same, so a
list of parts with a dozen tags per row gave no visual grouping at all -
even though tags are usually used in namespaces like "Risk:High" or
"Project:Foo".

An administrator can now define an ordered list of rules in the system
settings, which map a tag (exactly, or by prefix) to one of the semantic
Bootstrap colors. Tags which do not match any rule keep their previous
appearance, and only the color of a tag changes - filtering and
searching by tags are untouched.

At most one rule is applied per tag: an exact rule wins over a prefix
rule, the longest matching prefix wins among prefix rules, and the first
configured rule wins any remaining tie. The rules are resolved in one
place, so tags look the same in the part tables and on the part page.

Each rule row previews itself while it is edited. The rules only take
effect once the settings are saved, so a row which showed a fixed word
in the stored color gave no feedback about what is being typed: the
badge now shows the entered tag in the chosen color, a prefix rule marks
itself with an ellipsis, and a sentence below the row spells out what
the selected match type will match. That sentence is also the answer to
"exact or prefix?", which the two words alone do not explain.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant