Skip to content
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

Fix: Bump Textual to 0.85 #673

Merged
merged 10 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repos:
- click
- duckdb>=0.8.0
- shandy-sqlfmt[jinjafmt]
- textual>=0.76.0
- textual>=0.85.0
- textual-textarea>=0.14.0
- textual-fastdatatable>=0.9.0
- pytest
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Bug Fixes

- Fixes a hang and crash caused by an upstream bug in rendering zero-width containers ([#659](https://github.com/tconbeer/harlequin/issues/659), [#668](https://github.com/tconbeer/harlequin/issues/668), [#672](https://github.com/tconbeer/harlequin/issues/672)).

## [1.25.0] - 2024-10-09

### Features
Expand Down
9 changes: 5 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ build-backend = "poetry.core.masonry.api"
python = ">=3.8.1,<4.0.0"

# textual and component libraries
textual = "==0.76.0"
textual = "==0.85.0"
textual-fastdatatable = "==0.9.0"
textual-textarea = "==0.14.4"

Expand Down
2 changes: 1 addition & 1 deletion src/harlequin/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def compose(self) -> ComposeResult:
classes="non-responsive",
show_cancel_button=self.adapter.IMPLEMENTS_CANCEL,
)
self.footer = Footer()
self.footer = Footer(show_command_palette=False)

# lay out the widgets
with Horizontal():
Expand Down
26 changes: 15 additions & 11 deletions src/harlequin/colors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from typing import Dict, Type, Union
from __future__ import annotations

from typing import Dict, Type

from pygments.style import Style as PygmentsStyle
from pygments.styles import get_style_by_name
Expand Down Expand Up @@ -84,19 +86,20 @@ class HarlequinColorSystem(ColorSystem):
def __init__(
self,
primary: str,
secondary: Union[str, None] = None,
warning: Union[str, None] = None,
error: Union[str, None] = None,
success: Union[str, None] = None,
accent: Union[str, None] = None,
background: Union[str, None] = None,
surface: Union[str, None] = None,
panel: Union[str, None] = None,
boost: Union[str, None] = None,
secondary: str | None = None,
warning: str | None = None,
error: str | None = None,
success: str | None = None,
accent: str | None = None,
foreground: str | None = None,
background: str | None = None,
surface: str | None = None,
panel: str | None = None,
boost: str | None = None,
dark: bool = False,
luminosity_spread: float = 0.15,
text_alpha: float = 0.95,
text: Union[str, None] = None,
text: str | None = None,
):
super().__init__(
primary,
Expand All @@ -105,6 +108,7 @@ def __init__(
error,
success,
accent,
foreground,
background,
surface,
panel,
Expand Down
2 changes: 1 addition & 1 deletion src/harlequin/keys_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def compose(self) -> ComposeResult:
self.loading_indicator: LoadingIndicator | None = LoadingIndicator()
yield self.loading_indicator
# yield self.search_input
yield Footer()
yield Footer(show_command_palette=False)

def push_edit_modal(self, binding: HarlequinKeyBinding, cursor_row: int) -> None:
def update_binding(new_binding: HarlequinKeyBinding | None) -> None:
Expand Down
1,064 changes: 532 additions & 532 deletions tests/functional_tests/__snapshots__/test_app.ambr

Large diffs are not rendered by default.

456 changes: 229 additions & 227 deletions tests/functional_tests/__snapshots__/test_data_catalog.ambr

Large diffs are not rendered by default.

656 changes: 329 additions & 327 deletions tests/functional_tests/__snapshots__/test_export.ambr

Large diffs are not rendered by default.

63 changes: 32 additions & 31 deletions tests/functional_tests/__snapshots__/test_help_screen.ambr

Large diffs are not rendered by default.

97 changes: 49 additions & 48 deletions tests/functional_tests/__snapshots__/test_history_screen.ambr

Large diffs are not rendered by default.

719 changes: 363 additions & 356 deletions tests/functional_tests/__snapshots__/test_keys_app.ambr

Large diffs are not rendered by default.

240 changes: 120 additions & 120 deletions tests/functional_tests/__snapshots__/test_layout.ambr

Large diffs are not rendered by default.

865 changes: 437 additions & 428 deletions tests/functional_tests/__snapshots__/test_query_editor.ambr

Large diffs are not rendered by default.

242 changes: 122 additions & 120 deletions tests/functional_tests/__snapshots__/test_results_viewer.ambr

Large diffs are not rendered by default.

546 changes: 276 additions & 270 deletions tests/functional_tests/__snapshots__/test_run_query_bar.ambr

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions tests/functional_tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,21 +208,22 @@ async def test_multiple_queries(
assert app.results_viewer.tab_count == 2
assert "hide-tabs" not in app.results_viewer.classes
await wait_for_workers(app)
await pilot.pause(0.5)
await pilot.wait_for_scheduled_animations()
snap_results.append(await app_snapshot(app, "Both queries"))
assert app.results_viewer.active == "tab-2"
await pilot.press("k")
await pilot.wait_for_scheduled_animations()
assert app.results_viewer.active == "tab-1"
snap_results.append(await app_snapshot(app, "Both queries, tab 1"))
await pilot.press("k")
await pilot.wait_for_scheduled_animations()
assert app.results_viewer.active == "tab-2"
snap_results.append(await app_snapshot(app, "Both queries, tab 2"))
await pilot.press("j")
await pilot.press("k")
await pilot.wait_for_scheduled_animations()
assert app.results_viewer.active == "tab-1"
snap_results.append(await app_snapshot(app, "Both queries, tab 1"))
await pilot.press("j")
assert app.results_viewer.active == "tab-2"
await pilot.press("j")
assert app.results_viewer.active == "tab-1"

if not transaction_button_visible(app):
assert all(snap_results)
Expand Down
8 changes: 6 additions & 2 deletions tests/functional_tests/test_data_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,11 @@ async def test_file_tree(
mock_pyperclip: MagicMock,
) -> None:
snap_results: List[bool] = []
test_dir = (data_dir / "functional_tests" / "files").relative_to(Path.cwd())
test_dir = data_dir / "functional_tests" / "files"
relative_test_dir = test_dir.relative_to(Path.cwd())
app = Harlequin(
duckdb_adapter((":memory:",)),
show_files=test_dir,
show_files=relative_test_dir,
)
async with app.run_test(size=(120, 36)) as pilot:
while app.editor is None:
Expand All @@ -163,6 +164,9 @@ async def test_file_tree(
assert all(snap_results)


@pytest.mark.skipif(
sys.version_info >= (3, 12), reason="3.12 renders CSS differently for this test..."
)
@pytest.mark.asyncio
async def test_s3_tree(
duckdb_adapter: Type[DuckDbAdapter],
Expand Down