Skip to content

Commit 3d5ed4b

Browse files
authored
🔀 Merge pull request #101 from davep/update-enhanced
Update `textual-enhanced`
2 parents 90aa5c8 + 6933264 commit 3d5ed4b

File tree

8 files changed

+16
-383
lines changed

8 files changed

+16
-383
lines changed

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ authors = [
77
]
88
dependencies = [
99
"textual>=2.1.1",
10-
"textual-enhanced>=0.11.0",
10+
"textual-enhanced>=0.13.0",
1111
"textual-fspicker>=0.4.1",
1212
"xdg-base-dirs>=6.0.2",
1313
"httpx>=0.28.1",

requirements-dev.lock

+10-10
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
-e file:.
1313
aiohappyeyeballs==2.6.1
1414
# via aiohttp
15-
aiohttp==3.11.16
15+
aiohttp==3.11.18
1616
# via aiohttp-jinja2
1717
# via textual-dev
1818
# via textual-serve
@@ -46,7 +46,7 @@ distlib==0.3.9
4646
# via virtualenv
4747
filelock==3.18.0
4848
# via virtualenv
49-
frozenlist==1.5.0
49+
frozenlist==1.6.0
5050
# via aiohttp
5151
# via aiosignal
5252
ghp-import==2.1.0
@@ -57,7 +57,7 @@ httpcore==1.0.8
5757
# via httpx
5858
httpx==0.28.1
5959
# via hike
60-
identify==2.6.9
60+
identify==2.6.10
6161
# via pre-commit
6262
idna==3.10
6363
# via anyio
@@ -96,7 +96,7 @@ mkdocs==1.6.1
9696
# via mkdocs-material
9797
mkdocs-get-deps==0.2.0
9898
# via mkdocs
99-
mkdocs-material==9.6.11
99+
mkdocs-material==9.6.12
100100
mkdocs-material-extensions==1.3.1
101101
# via mkdocs-material
102102
msgpack==1.1.0
@@ -105,11 +105,11 @@ multidict==6.4.3
105105
# via aiohttp
106106
# via yarl
107107
mypy==1.15.0
108-
mypy-extensions==1.0.0
108+
mypy-extensions==1.1.0
109109
# via mypy
110110
nodeenv==1.9.1
111111
# via pre-commit
112-
packaging==24.2
112+
packaging==25.0
113113
# via mkdocs
114114
# via pytest
115115
paginate==0.5.7
@@ -154,18 +154,18 @@ six==1.17.0
154154
# via python-dateutil
155155
sniffio==1.3.1
156156
# via anyio
157-
textual==3.1.0
157+
textual==3.1.1
158158
# via hike
159159
# via textual-dev
160160
# via textual-enhanced
161161
# via textual-fspicker
162162
# via textual-serve
163163
textual-dev==1.7.0
164-
textual-enhanced==0.11.0
164+
textual-enhanced==0.13.0
165165
# via hike
166166
textual-fspicker==0.4.1
167167
# via hike
168-
textual-serve==1.1.1
168+
textual-serve==1.1.2
169169
# via textual-dev
170170
typing-extensions==4.13.2
171171
# via hike
@@ -182,5 +182,5 @@ watchdog==6.0.0
182182
# via mkdocs
183183
xdg-base-dirs==6.0.2
184184
# via hike
185-
yarl==1.19.0
185+
yarl==1.20.0
186186
# via aiohttp

requirements.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ rich==14.0.0
4444
# via textual
4545
sniffio==1.3.1
4646
# via anyio
47-
textual==3.1.0
47+
textual==3.1.1
4848
# via hike
4949
# via textual-enhanced
5050
# via textual-fspicker
51-
textual-enhanced==0.11.0
51+
textual-enhanced==0.13.0
5252
# via hike
5353
textual-fspicker==0.4.1
5454
# via hike

src/hike/screens/main.py

-19
Original file line numberDiff line numberDiff line change
@@ -382,64 +382,53 @@ def check_action(self, action: str, parameters: tuple[object, ...]) -> bool | No
382382
return self.query_one(Viewer).location is not None
383383
return True
384384

385-
@on(Reload)
386385
def action_reload_command(self) -> None:
387386
"""Reload the current document."""
388387
self.query_one(Viewer).reload()
389388

390-
@on(SearchBookmarks)
391389
def action_search_bookmarks_command(self) -> None:
392390
"""Search the bookmarks in the command palette."""
393391
self.show_palette(BookmarkCommands)
394392

395-
@on(SearchHistory)
396393
def action_search_history_command(self) -> None:
397394
"""search the history in the command palette."""
398395
self.show_palette(HistoryCommands)
399396

400-
@on(ToggleNavigation)
401397
def action_toggle_navigation_command(self) -> None:
402398
"""Toggle the display of the navigation panel."""
403399
self.navigation_visible = not self.navigation_visible
404400

405-
@on(ChangeNavigationSide)
406401
def action_change_navigation_side_command(self) -> None:
407402
"""Change the side that the navigation panel lives on."""
408403
navigation = self.query_one(Navigation)
409404
navigation.dock_right = not navigation.dock_right
410405
with update_configuration() as config:
411406
config.navigation_on_right = navigation.dock_right
412407

413-
@on(ChangeCommandLineLocation)
414408
def action_change_command_line_location_command(self) -> None:
415409
"""Change the location of the command line."""
416410
command_line = self.query_one(CommandLine)
417411
command_line.dock_top = not command_line.dock_top
418412
with update_configuration() as config:
419413
config.command_line_on_top = command_line.dock_top
420414

421-
@on(JumpToCommandLine)
422415
def action_jump_to_command_line_command(self) -> None:
423416
"""Jump to the command line."""
424417
if self.AUTO_FOCUS:
425418
self.query_one(self.AUTO_FOCUS).focus()
426419

427-
@on(JumpToDocument)
428420
def action_jump_to_document_command(self) -> None:
429421
"""Jump to the document."""
430422
self.query_one(Viewer).focus()
431423

432-
@on(Backward)
433424
def action_backward_command(self) -> None:
434425
"""Move backward through history."""
435426
self.query_one(Viewer).backward()
436427

437-
@on(Forward)
438428
def action_forward_command(self) -> None:
439429
"""Move forward through history."""
440430
self.query_one(Viewer).forward()
441431

442-
@on(BookmarkLocation)
443432
@work
444433
async def action_bookmark_location_command(self) -> None:
445434
"""Add the current location to the bookmarks."""
@@ -468,42 +457,34 @@ def _with_navigation_visible(self) -> Navigation:
468457
self.navigation_visible = True
469458
return self.query_one(Navigation)
470459

471-
@on(JumpToTableOfContents)
472460
def action_jump_to_table_of_contents_command(self) -> None:
473461
"""Jump to the table of contents."""
474462
self._with_navigation_visible().jump_to_content()
475463

476-
@on(JumpToLocalBrowser)
477464
def action_jump_to_local_browser_command(self) -> None:
478465
"""Jump to the local browser."""
479466
self._with_navigation_visible().jump_to_local()
480467

481-
@on(JumpToBookmarks)
482468
def action_jump_to_bookmarks_command(self) -> None:
483469
"""Jump to the bookmarks."""
484470
self._with_navigation_visible().jump_to_bookmarks()
485471

486-
@on(JumpToHistory)
487472
def action_jump_to_history_command(self) -> None:
488473
"""Jump to the history."""
489474
self._with_navigation_visible().jump_to_history()
490475

491-
@on(CopyLocationToClipboard)
492476
def action_copy_location_to_clipboard_command(self) -> None:
493477
"""Copy the current location to the clipboard."""
494478
self.post_message(CopyToClipboard(str(self.query_one(Viewer).location)))
495479

496-
@on(CopyMarkdownToClipboard)
497480
def action_copy_markdown_to_clipboard_command(self) -> None:
498481
"""Copy the current markdown to the clipboard."""
499482
self.post_message(CopyToClipboard(self.query_one(Viewer).source))
500483

501-
@on(Edit)
502484
def action_edit_command(self) -> None:
503485
"""Edit the current markdown document, if possible."""
504486
self.query_one(Viewer).edit()
505487

506-
@on(SaveCopy)
507488
@work
508489
async def action_save_copy_command(self) -> None:
509490
"""Save a copy of the current document to a new file."""

src/hike/support/__init__.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22

33
##############################################################################
44
# Local imports.
5-
from .history import History
65
from .mouse import is_copy_request_click
76
from .view_in_browser import view_in_browser
87

98
##############################################################################
109
# Exports.
11-
__all__ = ["History", "is_copy_request_click", "view_in_browser"]
10+
__all__ = ["is_copy_request_click", "view_in_browser"]
1211

1312
### __init__.py ends here

src/hike/support/history.py

-129
This file was deleted.

src/hike/types.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
from httpx import URL
1111

1212
##############################################################################
13-
# Local imports.
14-
from .support import History
13+
# Textual enhanced imports.
14+
from textual_enhanced.tools import History
1515

1616
##############################################################################
1717
HikeLocation: TypeAlias = Path | URL

0 commit comments

Comments
 (0)