Skip to content

Commit cefdcda

Browse files
vzhd1701claude
andcommitted
fix: what a search finds beside a list isn't stretched over the page
On a page a list or a table fills (Cookies, Link Resolution), a search that put the list away left its room to the cards found, stretched down the page. The room under the rows now takes it, as on any other page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 7a64d94 commit cefdcda

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

‎gridplayer/widgets/settings_form.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,9 @@ def __init__(
422422
self._add_items(items, joined=False)
423423
self._close_section()
424424

425-
if not self._fills:
426-
root.addStretch(1)
425+
# the room under the rows; on a page a list or a table fills, only
426+
# once a search has put it away, rather than the cards stretched
427+
root.addStretch(0 if self._fills else 1)
427428

428429
# what is modified waits for the values
429430
self._sync(keys=())

‎tests/test_settings_search.py‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,22 @@ def test_a_note_goes_with_the_rows_it_is_under(self, dialog):
307307
assert not _put_away(section)
308308
assert not any(_put_away(note) for note in form._notes)
309309

310+
@pytest.mark.parametrize(
311+
("page_id", "key"),
312+
[
313+
("cookies", "cookies/allow_update"),
314+
("resolution", "streaming/resolver_priority"),
315+
],
316+
)
317+
def test_what_is_found_beside_a_list_is_not_stretched(self, dialog, page_id, key):
318+
# the list that fills the page is away, and its room with it
319+
dialog.search("yt")
320+
dialog.show_page(page_id)
321+
_settle()
322+
323+
row = dialog.forms[page_id]._rows[key]
324+
assert row.height() == row.sizeHint().height()
325+
310326
def test_a_setting_pointed_at_is_out_of_the_search(self, dialog, mocker):
311327
mocker.patch.object(settings_dialog.QCustomMessageBox, "warning")
312328
key = "screenshots/filename_template"

0 commit comments

Comments
 (0)