feat(log-viewer): give each namespace its own stable colour - #943
Merged
lcottercertinia merged 3 commits intoAug 19, 2026
Conversation
Colours came from the log's namespace order and wrapped at eight, so a ninth namespace re-used the first colour and a package changed colour between logs. A namespace's name now picks its colour, and once the colour-blind-safe eight are taken the rest are generated across the hues in play, in bands of eight so lightness separates them as well. The namespace bar's cap becomes its own concern at 12 segments, no longer tied to how many colours exist.
Wong's eight hold three near-duplicate pairs: two blues 7.8 degrees apart, two magentas 11.7, and a green and a mint 14.9. Any log naming six namespaces showed such a pair, so two packages read as one colour. Keep the five that sit at least 29 degrees apart and generate the rest, which the palette holds 24 degrees apart while the wheel allows it.
The gap holds to twelve namespaces and narrows past it. Spreading hues evenly would hold it further but cannot be colour-blind safe, so the literals are not replaceable by a generated spread.
lcottercertinia
approved these changes
Aug 19, 2026
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.
Namespace colours came from the log's namespace order and wrapped at eight, so a ninth namespace re-used the first colour and a package changed colour between logs.
What changes
defaultalways holds the first.namespaceTime.ts, which walks the tree, intocomponents/namespacePalette.ts.MAX_SEGMENTSon the namespace bar becomes its own concern at 12, no longer tied to how many colours exist. The tail (N others) is unchanged.Colours stay literal, as the timeline categories do: they show meaning, not chrome, so they do not follow the host theme.
Measured
Over the whole palette, literals included, at a range of namespace counts:
The literals themselves span 0.118–0.170 chroma, so no generated colour reads as a dull one. Building the palette takes 9–41 ms for 12 to 40 namespaces, and the candidate table is built only on the first log holding more namespaces than there are literals.
Known limits
Alternatives considered
360/nat every count and lifts cross-log recognisability from 44% to 66% at eight namespaces. Rejected on colour-blind safety: simulated deuteranopia separation falls from 0.156 to 0.005, and cannot be fixed, since an evenly-spread wheel collapses red against green.Checks
tsc -b,eslint,prettier --checkclean; production build clean.No CHANGELOG entry: the namespace bar and the inspector section are still unreleased (#939, #373), and neither entry mentions colours.