Repository navigation
Conversation
Pure move of the palette var block (8 AdaptiveColor tokens plus modelColors) out of tui.go, with a comment mapping each token to its role. No value changes; tui.go keeps its lipgloss import.
The palette was already AdaptiveColor pairs, but which side renders was decided solely by termenv background detection, which silently falls back to dark when the terminal cannot be asked. Members on light terminals over SSH or multiplexers had no override. - ThemeMode (auto/dark/light) persisted in ~/.config/nan/settings.json, read-modify-write so foreign keys survive and an unparseable file is never flattened; missing/corrupt/unknown loads as auto. - applyTheme pins lipgloss's renderer background flag; auto stays the documented no-op so detection keeps its current behavior. - t cycles the mode from any tab, applies it on the next frame and persists it; Run() applies the saved mode before the first frame. - About gained an Appearance row naming what auto resolved to; help and the wide footer hint mention the key. - modelColors became AdaptiveColor pairs with light-tuned values so the five categorical colors stay distinguishable on white.
Findings from the pre-PR review (risk/resilience/readability/reliability over a8057e0..d134a9b); none blocked, these are the ones worth fixing now: - reliability CRITICAL: the core contract was never asserted end to end. New test renders the tab bar with the profile pinned to truecolor and the background pinned dark vs light, asserting the panel actually repaints — coverage no longer stops at the renderer flag. - test hygiene: every test that mutates lipgloss's global background flag (and its color profile) now restores the previous value via t.Cleanup, removing hidden order coupling for -shuffle and future tests in the same binary. - coverage: the third press of the cycle must persist "auto" to the file (raw bytes, not loadThemeFrom, which maps unknowns back to auto); saveThemeTo normalizes unknown modes to auto; a refused save still applies the mode in memory. - risk: settings.json is shared, so its read side now decodes with json.Number instead of float64 — a foreign integer past 2^53 survives the round-trip byte-faithfully, with readJSONConfig's refusal semantics (missing/empty tolerated, unparseable and trailing data never rewritten). - readability: the config-dir rule is exported once as session.Dir and reused by settingsPath, so the theme file cannot drift away from session.json. Deferred as follow-ups: user-visible notice when the theme save fails (deliberate swallow, documented), cwd-relative fallback semantics, folding the remaining fixed colors into theme.go, hue-name tokens.
The `.atl/` directory is local tooling state (skill registry output), not shipped content. Anchored to the repo root so it does not silently swallow a same-named path at any depth.
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.
El modo claro ya estaba casi entero —casi todos los tokens de la paleta son parejas
AdaptiveColor— pero no había forma de pedirlo: el lado lo elige termenv preguntándole al terminal, y cuando no puede (SSH, algunos multiplexores) cae a oscuro sin decir nada. No había override, ni un sitio donde ver en qué modo estás.Ahora
tcicla auto → oscuro → claro, se aplica en el frame siguiente sin reiniciar y se recuerda entre ejecuciones.autoes exactamente el comportamiento de antes: termenv decide, con la misma caída a oscuro.internal/tui/theme.go, con los mismos valores y el papel de cada token anotado al lado.modelColorspasa aAdaptiveColoryrenderBarrecibelipgloss.TerminalColor, que es lo que le deja seguir pintando igual desde el fichero nuevo. Es un movimiento, no un rediseño: los violetas de marca y los píxeles de la mascota no se tocan.~/.config/nan/settings.json({"theme":"auto"}), con lectura-modificación-escritura que preserva las claves que no son nuestras: el fichero es compartido y no lo escribimos solo nosotros. Ausente, corrupto o con un modo desconocido →auto. La lectura usajson.DecoderconUseNumberpara no reescribir números ajenos cambiándoles el tipo, y rechaza datos sobrantes al final del fichero.auto), entrada en la ayuda y pista en el pie en terminales anchos. Si guardar falla, el tema se aplica igual en esa ejecución; el aviso al usuario queda como follow-up.nan theme: la decisión era la tecla global y la fila en About.internal/tui/theme.gointernal/tui/theme_test.gointernal/tui/tui.got, fila Theme, ayuda, pista del pie, yRun()aplica el modo antes del primer frameinternal/tui/config_test.gonewModelyrenderAbout)internal/session/session.godir()pasa aDir()para que el ajuste caiga en el mismo directorio de config que la sesión.gitignore/.atl/, estado local de las herramientas, anclado a la raízPruebas
go build ./...,go vet ./...,gofmt -l internal/ cmd/(sin salida) ygo test ./... -count=1: todo en verde. Es lo mismo que corre CI, más el cross-compile de los seis targets.auto, negativa a guardar sobre un fichero que no parsea, orden del ciclo, y queautoes el único camino que no llama aSetHasDarkBackground(comprobado por grep además de por test).trepinta el panel— se comprueba de extremo a extremo: perfil truecolor fijado y fondo oscuro contra claro, afirmando sobre los bytes pintados y no sobre el flag del renderer. Los tests que tocan ese flag global lo restauran ent.Cleanup, así que no dependen del orden de ejecución.testá guardada como las demás globales (no se dispara con la ayuda abierta ni dentro del wizard).mainactual (d929e5f, ya con fix(codex): los perfiles sin las herramientas que el cluster no streamea, y precios nuevos en Costs #35–chore: 0.1.23 #39 dentro) sin conflictos y vuelto a verificar después: los símbolos del tema y las cinco zonas que upstream también tocó (Update,renderAbout,renderSetup,renderHelp,Run) quedan enteras en los dos sentidos, sin funciones duplicadas ni restos del merge.No verificado