mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 10:53:59 +00:00
feat(location): render the search field's open and searching state from the tray
LocationControls presents whether the search field is open and whether a lookup runs, and the dock renders its expanded and searching classes and calls toggleSearch(). The lookup, the navigation's settle, Escape and the location tray's collapse reach the field through the controls (setSearching, settleSearch, closeSearch) instead of writing its classes. LocationControls no longer takes searchToggle, LocationSearch takes setSearching and NavigationController takes settleSearch in place of searchInput.
This commit is contained in:
1 parent
b4ee2321cf
commit
0949f6a776
18 files changed
+238
-83
No files matched your search
@@ -151,17 +151,12 @@ test('a collapsed nested panel does not block the next Escape from closing its p
|
||||
|
||||
test('Location Escape clears a hidden draft search before restoring disclosure focus', () => {
|
||||
const fixture = panelFixture({ id: 'location-bar' });
|
||||
const removed = [];
|
||||
let blurred = false;
|
||||
fixture.manager._locationSearch = {
|
||||
classList: { remove: (...names) => removed.push(...names) },
|
||||
value: 'focus cleanup',
|
||||
blur: () => { blurred = true; },
|
||||
};
|
||||
// The location controls close the field and drop its draft
|
||||
// (src/ui/locationControls.test.mjs).
|
||||
let closed = 0;
|
||||
fixture.manager._closeLocationSearch = () => { closed += 1; };
|
||||
assert.equal(fixture.manager._collapsePanelOnEscape(fixture.event, 'location-bar'), true);
|
||||
assert.deepEqual(removed, ['expanded']);
|
||||
assert.equal(fixture.manager._locationSearch.value, '');
|
||||
assert.equal(blurred, true);
|
||||
assert.equal(closed, 1);
|
||||
assert.equal(fixture.focused(), true);
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user