EnhancedJax / Bagels

Powerful expense tracker that lives in your terminal.
GNU General Public License v3.0
114 stars 3 forks source link

When scrolling down in the pallete, a KeyError is raised for `posting`. #8

Closed jw closed 16 hours ago

jw commented 1 day ago

Installed via uv tool install --python 3.13 bagels.

❯ bagels 
╭────────────────────────────────────────────────────────────────── Traceback (most recent call last) ───────────────────────────────────────────────────────────────────╮
│ /home/jw/.local/share/uv/tools/bagels/lib/python3.13/site-packages/bagels/app.py:120 in palette_option_highlighted                                                     │
│                                                                                                                                                                        │
│   117 │   │   │   │   if value in self.themes:                                                                                                                         │
│   118 │   │   │   │   │   self.app_theme = value                                                                                                                       │
│   119 │   │   │   else:                                                                                                                                                │
│ ❱ 120 │   │   │   │   self.app_theme = self._original_theme                                                                                                            │
│   121 │                                                                                                                                                                │
│   122 │   @on(CommandPalette.Closed)                                                                                                                                   │
│   123 │   def palette_closed(self, event: CommandPalette.Closed) -> None:                                                                                              │
│                                                                                                                                                                        │
│ ╭────────────────────────────────────────────────────────────────────── locals ───────────────────────────────────────────────────────────────────────╮                │
│ │ command_name = 'app: quit'                                                                                                                          │                │
│ │        event = OptionHighlighted()                                                                                                                  │                │
│ │         name = 'app'                                                                                                                                │                │
│ │       prompt = Content('app: quit\nQuit App', spans=[Span(10, 18, style=Style(Color(0, 0, 0, a=0), Color(0, 0, 0, a=0.6, auto=True), bold=False))]) │                │
│ │         self = App(title='App', classes={'-dark-mode'}, pseudo_classes={'dark', 'focus'})                                                           │                │
│ │        value = 'quit'                                                                                                                               │                │
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                │
│                                                                                                                                                                        │
│ /home/jw/.local/share/uv/tools/bagels/lib/python3.13/site-packages/bagels/app.py:99 in watch_app_theme                                                                 │
│                                                                                                                                                                        │
│    96 │   │   self.refresh_css(animate=False)                                                                                                                          │
│    97 │   │   self.screen._update_styles()                                                                                                                             │
│    98 │   │   if theme:                                                                                                                                                │
│ ❱  99 │   │   │   theme_object = self.themes[theme]                                                                                                                    │
│   100 │   │   │   self.theme_change_signal.publish(theme_object)                                                                                                       │
│   101 │                                                                                                                                                                │
│   102 │   @on(CommandPalette.Opened)                                                                                                                                   │
│                                                                                                                                                                        │
│ ╭────────────────────────────────────── locals ──────────────────────────────────────╮                                                                                 │
│ │  self = App(title='App', classes={'-dark-mode'}, pseudo_classes={'dark', 'focus'}) │                                                                                 │
│ │ theme = 'posting'                                                                  │                                                                                 │
│ ╰────────────────────────────────────────────────────────────────────────────────────╯                                                                                 │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
KeyError: 'posting'
EnhancedJax commented 16 hours ago

Thanks for the report! Please upgrade to 0.1.11 and change your theme! (posting is an invalid theme name that was initialized by the app in the last version).

Entirely my fault, should really start writing tests for the app lol