-
Notifications
You must be signed in to change notification settings - Fork 27
✨ feat: integrate TextArea viewer and Keyboard Shortcuts widget #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
juftin
wants to merge
55
commits into
main
Choose a base branch
from
feature/textarea-integration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
8ec8ac8
📝 spec: add design for TextWindow integration using TextArea
juftin 00f44db
📝 spec: expand research and resource details in design doc
juftin 22e37f7
📝 docs: add Textual TextArea references to spec and project documenta…
juftin b9b30be
feat: add TextWindow widget based on TextArea
juftin 5314ae1
feat: implement smart theme and language mapping for TextWindow
juftin 1ff7296
feat: update WindowSwitcher to route code and JSON to TextWindow
juftin 336acf3
fix: final polish, theme updates and snapshot verification of TextWindow
juftin 12e989d
fix: make line numbers dynamic and synchronized across windows
juftin 1b9e995
fix: update snapshots after line number synchronization fix
juftin a90c5e7
feat: synchronize themes and dark mode across windows
juftin 97ac08f
fix: refine subtitle updates and theme synchronization for TextWindow
juftin 89b8075
feat: implement window-specific theme cycling for TextArea and Static…
juftin 6575787
feat: implement comprehensive language mapping for TextWindow
juftin 172f24e
feat: implement smarter language detection with FILENAME_MAP
juftin cd1664a
chore: enable syntax highlighting for Textual by adding syntax extra
juftin be35e5a
feat: default TextWindow theme to vscode_dark and persist between files
juftin 2110636
feat: add Shift+C copy binding and ensure theme persistence for TextW…
juftin 4bf5ad1
feat: explicitly bind Shift+C for copying selected text in code files
juftin d22071e
feat: use 'C' for shift+c binding with correct visual display in footer
juftin 7d6e83c
refactor: polish TextArea integration, move maps to config, and simpl…
juftin 4402905
feat: use ordered textarea_theme_map for theme cycling in TextWindow
juftin a1c48a1
refactor: use OrderedDict only for textarea_theme_map and clean up ot…
juftin 4f131ec
copy text + bindings
juftin 4fe63a8
✨ feat: finalize textarea integration and orjson migration
juftin 63b1974
🚨 fix: resolve mypy type checking errors in windows.py
juftin f34a858
refactor: revert orjson to stdlib json
juftin bc75b2b
Merge remote-tracking branch 'origin/main' into feature/textarea-inte…
juftin 8c8cb08
renderable
juftin 6fba29b
snapshot updates
juftin 644804f
✨ (docs): Add design spec for Keyboard Shortcuts widget
juftin 59fb282
♻️ (docs): Refine design spec for Keyboard Shortcuts widget
juftin 01ade67
✨ (docs): Add implementation plan for Keyboard Shortcuts widget
juftin 995a026
♻️ (docs): Refine implementation plan for Keyboard Shortcuts widget
juftin 47112d6
✨ (widgets): Add ShortcutsWindow and ShortcutsPopUp widgets
juftin 770eb77
✨ (app): Integrate shortcuts window globally
juftin 844dd95
✅ (tests): Add tests and snapshots for shortcuts widget
juftin d7ed366
✅ (tests): Update snapshots after adding global shortcuts binding
juftin 03c18f4
✨ (shortcuts): Finalize implementation with keyboard support and fix …
juftin a4a6c2d
🎨 (shortcuts): Make ShortcutsWindow and ConfirmationWindow true overl…
juftin 9516726
🐛 (shortcuts): Remove q binding from shortcuts window to avoid overri…
juftin a10f9b1
✨ (confirmation): Support esc to close the confirmation window
juftin 68f537d
📝 (docs): Add implementation summary for Keyboard Shortcuts and TextA…
juftin c874278
♻️ (refactor): Fix recursion in TextWindow theme handling and abstrac…
juftin 355f67a
♻️ (refactor): Break down large methods into smaller helpers for bett…
juftin e689e6d
🐛 (fix): Update snapshots after theme fix
juftin 7c2dd39
🐛 (fix): Correct theme cycling in WindowSwitcher
juftin e583549
🐛 (confirmation): Fix double buttons in confirmation window
juftin 0c6fa99
♻️ (refactor): Final optimizations for WindowSwitcher and CodeBrowser
juftin 2b7319d
🐛 (fix): Add missing get_file_info import in windows.py
juftin f7f547a
♻️ (refactor): Finalize typing and code quality improvements
juftin b996c7b
whitelisted shortcuts
juftin dad6f11
✨ (shortcuts): Hide ctrl+q and use trusted actions list
juftin d720f15
📝 docs update
juftin 95a71fb
Merge remote-tracking branch 'origin/main' into feature/textarea-inte…
juftin 3bb8cbd
test fix
juftin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| """ | ||
| Base classes for widgets | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from typing import ClassVar | ||
|
|
||
| from textual import on | ||
| from textual.binding import Binding, BindingType | ||
| from textual.containers import Container | ||
| from textual.message import Message | ||
|
|
||
|
|
||
| class BasePopUp(Container): | ||
| """ | ||
| Base class for popup widgets | ||
| """ | ||
|
|
||
| can_focus = True | ||
|
|
||
| BINDINGS: ClassVar[list[BindingType]] = [ | ||
| Binding("escape", "close", "Close", show=False), | ||
| ] | ||
|
|
||
| class Toggle(Message): | ||
| """ | ||
| Toggle the popup visibility | ||
| """ | ||
|
|
||
| def __init__(self, display: bool | None = None) -> None: | ||
| self.display = display | ||
| super().__init__() | ||
|
|
||
| def action_close(self) -> None: | ||
| """ | ||
| Close the popup | ||
| """ | ||
| self.post_message(self.Toggle(display=False)) | ||
|
|
||
|
|
||
| class BaseOverlay(Container): | ||
| """ | ||
| Base class for overlay containers | ||
| """ | ||
|
|
||
| can_focus = True | ||
|
|
||
| BINDINGS: ClassVar[list[BindingType]] = [ | ||
| Binding("escape", "close", "Close", show=False), | ||
| ] | ||
|
|
||
| def action_close(self) -> None: | ||
| """ | ||
| Close the overlay | ||
| """ | ||
| self.display = False | ||
|
|
||
| def on_mount(self) -> None: | ||
| """ | ||
| On Mount | ||
| """ | ||
| self.display = False | ||
|
|
||
| def watch_display(self, display: bool) -> None: | ||
| """ | ||
| Focus the overlay when it is displayed | ||
| """ | ||
| if display: | ||
| self.focus() | ||
|
|
||
| @on(BasePopUp.Toggle) | ||
| def handle_toggle(self, message: BasePopUp.Toggle) -> None: | ||
| """ | ||
| Handle the toggle message from the popup | ||
| """ | ||
| if message.display is not None: | ||
| self.display = message.display | ||
| else: | ||
| self.display = not self.display | ||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why a
Togglemessage instead of calling the overlay's method directly?BasePopUpis always a child ofBaseOverlay, but the popup shouldn't hold a reference to its parent. Posting aTogglemessage letsBaseOverlayhandle visibility in its ownon(BasePopUp.Toggle)handler — keeping the popup and overlay decoupled.