Repository navigation
Draw custom lane colours, and mix one on Account - #15
Merged
Merged
Conversation
The web lets people pick any colour for their lane, and devnull sends it as
a #rrggbb lane. The app read that as no lane and fell back to the hashed
one, so those people showed in the wrong colour.
A custom colour now becomes a theme token of its own, lane-rrggbb, the
first time it's drawn, with a label colour picked the way the palette's
on-lane tokens are. Every view draws lanes through Lane::token(), so rails,
avatars, profiles, notifications, the tab bar and the main buttons all take
it. Like the web, it's the same colour in light and dark mode.
Account gets the web's Custom option after the six lanes. It opens a sheet
with hue, saturation and lightness sliders, standing in for the system
colour picker the web opens, and Save color sends {"lane": null, "color"}
as the web's form does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sliders were debounced, and iOS only sends a debounced slider once the finger rests, so the swatch didn't change until you stopped dragging. They now send every step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The web now lets people pick any colour for their lane with a colour picker, and devnull sends that lane as a
#rrggbbstring instead of 0 to 5. The app treated it as no lane and fell back to the hashed one, so anyone with a custom colour showed up in the wrong colour.What changed
Lane::from()reads a custom colour as lowercase#rrggbb.Lane::palette()is the old 0 to 5 reader, for Automatic and the picker's buttons.Lane::token()turns a custom colour into a theme token of its own,lane-rrggbb, the first time it's drawn, throughTheme::merge(). It gets anon-token for button labels, white or ink by the same contrast rule as the palette's. Like the web, it's the same colour in light and dark mode.bg-theme-{{ Lane::token($lane) }}instead ofbg-theme-lane-{{ $lane }}. That covers rails, avatar rings, profiles, achievements, activity, notifications, the tab bar accent and the lane-coloured buttons. Rail Gray goes throughtoken()too, which removed a few ternaries.{"lane": null, "color": "#rrggbb"}like the web's form.Hslclass does the colour maths.Worth checking
bg-[#rrggbb]class rather than a token, so dragging a slider doesn't add a theme token on every tick. Only the colour you use becomes one.Theme::merge()pushes the theme to the native side, so the first time a new custom colour is drawn there's one extra bridge call. I haven't seen this on a device yet.PUT /api/v1/me/laneto takecolor, which is in feat: sync from GitHub and save the lane color from the API nunomaduro/dev-null.sh#554. Drawing other people's custom colours works against production today.Testing
846 tests pass and Pint is clean. New tests cover reading and tokenising custom colours, the HSL maths, drawing a custom colour on the Log, a profile, the tab bar and the main buttons, and mixing, previewing, saving and dismissing on Account. Not yet tried on a phone or simulator.
Closes the idea board's to-do #322.
🤖 Generated with Claude Code