Skip to content

Commit e0db178

Browse files
authored
Merge pull request #60 from NikiforovAll/feature/more-themes
feat: add lazygit theme
2 parents 2bac371 + 9056038 commit e0db178

File tree

12 files changed

+1094
-828
lines changed

12 files changed

+1094
-828
lines changed

src/lazyclaude/app.py

Lines changed: 64 additions & 820 deletions
Large diffs are not rendered by default.

src/lazyclaude/bindings.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
"""App keybindings configuration."""
2+
3+
from textual.binding import Binding, BindingType
4+
5+
APP_BINDINGS: list[BindingType] = [
6+
Binding("q", "quit", "Quit"),
7+
Binding("?", "toggle_help", "Help"),
8+
Binding("r", "refresh", "Refresh"),
9+
Binding("e", "open_in_editor", "Edit"),
10+
Binding("c", "copy_customization", "Copy"),
11+
Binding("m", "move_customization", "Move"),
12+
Binding("d", "delete_customization", "Delete"),
13+
Binding("C", "copy_config_path", "Copy Path"),
14+
Binding("tab", "focus_next_panel", "Next Panel", show=False),
15+
Binding("shift+tab", "focus_previous_panel", "Prev Panel", show=False),
16+
Binding("a", "filter_all", "All"),
17+
Binding("u", "filter_user", "User"),
18+
Binding("p", "filter_project", "Project"),
19+
Binding("P", "filter_plugin", "Plugin"),
20+
Binding("D", "toggle_plugin_enabled_filter", "Disabled"),
21+
Binding("t", "toggle_plugin_enabled", "Toggle"),
22+
Binding("/", "search", "Search"),
23+
Binding("[", "prev_view", "[", show=True),
24+
Binding("]", "next_view", "]", show=True),
25+
Binding("0", "focus_main_pane", "Panel 0", show=False),
26+
Binding("1", "focus_panel_1", "Panel 1", show=False),
27+
Binding("2", "focus_panel_2", "Panel 2", show=False),
28+
Binding("3", "focus_panel_3", "Panel 3", show=False),
29+
Binding("4", "focus_panel_4", "Panel 4", show=False),
30+
Binding("5", "focus_panel_5", "Panel 5", show=False),
31+
Binding("6", "focus_panel_6", "Panel 6", show=False),
32+
Binding("7", "focus_panel_7", "Panel 7", show=False),
33+
Binding("ctrl+u", "open_user_config", "User Config", show=False),
34+
Binding("M", "toggle_marketplace", "Marketplace", show=True, priority=True),
35+
Binding("escape", "exit_preview", "Exit Preview", show=True, priority=True),
36+
Binding("escape", "back", "Back", show=False),
37+
]

src/lazyclaude/mixins/CLAUDE.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Mixins Module
2+
3+
This module contains mixin classes that extend `LazyClaude` app functionality through multiple inheritance.
4+
5+
## Architecture
6+
7+
```python
8+
class LazyClaude(
9+
NavigationMixin, # Panel focus & navigation
10+
FilterMixin, # Level/search filtering
11+
MarketplaceMixin, # Plugin marketplace browser
12+
CustomizationActionsMixin, # Copy/move/delete operations
13+
HelpMixin, # Help overlay
14+
App, # Textual base class (must be last)
15+
):
16+
```
17+
18+
## Mixin Overview
19+
20+
| Mixin | Purpose | Key Methods |
21+
|-------|---------|-------------|
22+
| `NavigationMixin` | Panel focus, view switching | `action_focus_panel_*`, `action_prev/next_view`, `action_back` |
23+
| `FilterMixin` | Level filters, search | `action_filter_*`, `action_search`, `_update_status_filter` |
24+
| `MarketplaceMixin` | Plugin browser, preview mode | `action_toggle_marketplace`, `on_marketplace_modal_*` |
25+
| `CustomizationActionsMixin` | CRUD operations | `action_copy/move/delete_customization`, `on_*_confirm_*` |
26+
| `HelpMixin` | Help overlay toggle | `action_toggle_help`, `_show_help`, `_hide_help` |
27+
28+
## How Mixins Work
29+
30+
1. **Method Resolution Order (MRO)**: Python resolves methods left-to-right, then up. Textual's `action_*` and `on_*` method discovery works via MRO.
31+
32+
2. **Shared State**: Mixins access app state through `self._*` attributes defined in `LazyClaude.__init__`.
33+
34+
3. **Type Hints**: Use `TYPE_CHECKING` guard to avoid circular imports:
35+
```python
36+
from typing import TYPE_CHECKING
37+
38+
if TYPE_CHECKING:
39+
from lazyclaude.widgets.type_panel import TypePanel
40+
41+
class NavigationMixin:
42+
_panels: list["TypePanel"] # Type stub for IDE support
43+
```
44+
45+
4. **Cross-Mixin Calls**: Use `# type: ignore[attr-defined]` for methods defined in other mixins or App:
46+
```python
47+
self._update_panels() # type: ignore[attr-defined]
48+
self.notify("message") # type: ignore[attr-defined]
49+
```
50+
51+
## Adding New Functionality
52+
53+
1. Identify if functionality belongs in existing mixin or needs new one
54+
2. For new mixin:
55+
- Create `mixins/<name>.py`
56+
- Define class with type stubs for accessed attributes
57+
- Export from `mixins/__init__.py`
58+
- Add to `LazyClaude` inheritance (before `App`)
59+
3. For existing mixin: add methods directly
60+
61+
## File Responsibilities
62+
63+
- `navigation.py`: Focus management, panel switching, view toggling
64+
- `filtering.py`: ConfigLevel filters, search query, status updates
65+
- `marketplace.py`: Plugin browser, preview mode, plugin commands
66+
- `customization_actions.py`: Copy/move/delete, level selector, confirmations
67+
- `help.py`: Help overlay display

src/lazyclaude/mixins/__init__.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"""Mixins for LazyClaude application."""
2+
3+
from lazyclaude.mixins.customization_actions import CustomizationActionsMixin
4+
from lazyclaude.mixins.filtering import FilterMixin
5+
from lazyclaude.mixins.help import HelpMixin
6+
from lazyclaude.mixins.marketplace import MarketplaceMixin
7+
from lazyclaude.mixins.navigation import NavigationMixin
8+
9+
__all__ = [
10+
"NavigationMixin",
11+
"FilterMixin",
12+
"MarketplaceMixin",
13+
"CustomizationActionsMixin",
14+
"HelpMixin",
15+
]

0 commit comments

Comments
 (0)