Skip to content

Fix theme cycling destroying UI layout#36

Merged
shranchi0 merged 1 commit intoAshirBorah:mainfrom
shranchi0:fix/ui-polish
Feb 18, 2026
Merged

Fix theme cycling destroying UI layout#36
shranchi0 merged 1 commit intoAshirBorah:mainfrom
shranchi0:fix/ui-polish

Conversation

@shranchi0
Copy link
Collaborator

Summary

  • Theme cycling (Ctrl+T) used stylesheet.source.clear() + reparse() + update() which destroyed widget DEFAULT_CSS rules — sidebar disappeared, welcome text vanished, status bar lost centering
  • Replaced with direct inline style application via .styles.background / .styles.color on Screen, HeaderBar, SessionViewer, and StatusBar
  • Theme colors defined as THEME_COLORS dict in tame/ui/themes/manager.py alongside existing .tcss files
  • Removed hardcoded Screen { background; color } from TAMEApp.CSS so initial theme controls it

Test plan

  • All 268 tests pass
  • ruff / mypy clean
  • Open app, cycle all 8 themes with Ctrl+T — sidebar, welcome screen, and status bar centering should all stay intact, only colors change

…lation

The previous approach called stylesheet.source.clear() + reparse() +
update() which destroyed widget DEFAULT_CSS rules, collapsing the UI
to a flat colored screen with no sidebar, no welcome text, and lost
status bar centering.

Replace with direct inline style application: cycle() picks the next
theme, then sets background/color on Screen, HeaderBar, SessionViewer,
and StatusBar via their .styles property. This leaves the stylesheet
and all widget DEFAULT_CSS completely untouched.

Theme colors are defined as a THEME_COLORS dict in the theme manager
alongside the existing .tcss files.
@shranchi0 shranchi0 merged commit fde673a into AshirBorah:main Feb 18, 2026
5 checks passed
@shranchi0 shranchi0 deleted the fix/ui-polish branch February 18, 2026 20:05
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

Comments