MCPcopy
hub / github.com/docker/docker-agent / handleThemeFileChanged

Method handleThemeFileChanged

pkg/tui/handlers.go:707–717  ·  view source on GitHub ↗

handleThemeFileChanged hot-reloads a theme that was modified on disk.

(themeRef string)

Source from the content-addressed store, hash-verified

705
706// handleThemeFileChanged hot-reloads a theme that was modified on disk.
707func (m *appModel) handleThemeFileChanged(themeRef string) (tea.Model, tea.Cmd) {
708 theme, err := styles.LoadTheme(themeRef)
709 if err != nil {
710 return m, notification.ErrorCmd(fmt.Sprintf("Failed to hot-reload theme: %v", err))
711 }
712 styles.ApplyTheme(theme)
713 return m, tea.Batch(
714 notification.SuccessCmd("Theme hot-reloaded"),
715 core.CmdHandler(messages.ThemeChangedMsg{}),
716 )
717}
718
719// --- Miscellaneous ---
720

Callers 1

updateMethod · 0.95

Calls 6

LoadThemeFunction · 0.92
ErrorCmdFunction · 0.92
ApplyThemeFunction · 0.92
SuccessCmdFunction · 0.92
CmdHandlerFunction · 0.92
BatchMethod · 0.80

Tested by

no test coverage detected