Skip to content
Closed
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
5 changes: 3 additions & 2 deletions CommunityStore/ui/store.css
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,9 @@ main:has(#installed:not([hidden])) {scrollbar-gutter:stable}
#notice-dismiss:hover {background:var(--hover)}
table {width:100%;border-collapse:separate;border-spacing:0}
.installed-table {table-layout:fixed}
.installed-table .store-row:not(:last-child) {--row-divider:3px solid var(--line)}
.installed-table thead {position:sticky;top:0;z-index:1;background:var(--surface)}
.installed-table th, .installed-table td {padding:5px 4px;text-align:center;border-bottom:1px solid var(--soft-line)}
.installed-table th, .installed-table td {padding:5px 4px;text-align:center;border-bottom:var(--row-divider,1px solid var(--soft-line))}
.installed-table thead th {font-size:11px;line-height:1.2;font-weight:650;color:var(--secondary);height:32px;vertical-align:middle;border-block-start:1px solid var(--soft-line)}
.installed-table :is(.source-cell,.author-cell) {display:none;text-align:start;overflow-wrap:anywhere}
.installed-credits {display:flex;flex-wrap:wrap;gap:1px 8px;margin-top:1px;color:var(--muted);font-size:12px;font-weight:450}
Expand Down Expand Up @@ -453,7 +454,7 @@ fieldset label.unavailable { color: var(--muted); }
#toolbar:has(#sources:not([hidden])) #check:not([data-checking]) span {display:none}
.installed-table, .installed-table tbody {display:block}
.installed-table thead {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.installed-table tbody tr {display:grid;grid-template-columns:22px minmax(90px,1fr) minmax(96px,1fr) repeat(2,minmax(0,1fr)) 32px;gap:5px 6px;align-items:start;padding:8px 3px;border-bottom:1px solid var(--soft-line)}
.installed-table tbody tr {display:grid;grid-template-columns:22px minmax(90px,1fr) minmax(96px,1fr) repeat(2,minmax(0,1fr)) 32px;gap:5px 6px;align-items:start;padding:8px 3px;border-bottom:var(--row-divider,1px solid var(--soft-line))}
.installed-table tbody :is(th,td) {width:auto;min-width:0;padding:0;border:0;text-align:start}
.installed-table .selection-cell {grid-column:1;grid-row:1;align-self:center;text-align:center}
.installed-table .identity-cell {grid-column:2/-2;grid-row:1}
Expand Down
11 changes: 7 additions & 4 deletions CommunityStore/ui/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ function installedRow(row) {
const tr = node("tr");
tr.setAttribute("role", "row");
tr.dataset.row = row.key;
if (row.self) tr.classList.add("store-row");
const cell = (name, label, heading = false) => {
const element = node(heading ? "th" : "td", name + "-cell");
element.setAttribute("role", heading ? "rowheader" : "cell");
Expand Down Expand Up @@ -964,14 +965,16 @@ function render() {
if (detail) {
renderDetails(details.local, details.entry, details.installations);
} else if (tab === "installed") {
const rows = state.installed.filter((row) => matches(row) &&
const matching = state.installed.filter((row) => matches(row) &&
(!updatesOnly || row.update || row.newerTag));
if (search || updatesOnly) filteredCount = rows.length;
const store = state.installed.find((row) => row.self);
const rows = store ? [store, ...matching.filter((row) => !row.self)] : matching;
if (search || updatesOnly) filteredCount = matching.length;
replaceList(tab, find("installed-body"), rows, installedRow);
const empty = find("installed-empty");
empty.hidden = Boolean(rows.length);
empty.hidden = Boolean(matching.length);
find("installed").querySelector("table").hidden = !rows.length;
if (!rows.length) {
if (!matching.length) {
if (search || updatesOnly) {
renderEmpty(empty, search ? "search_empty" : "updates_empty", clearFilters, "clear_filters");
} else {
Expand Down
23 changes: 23 additions & 0 deletions tests/test_palette_browser.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,29 @@ test("palette actions, keyboard focus and localization", async (suite) => {
}
});

await suite.test("the Store stays first and separate when filtering installed add-ins", async (test) => {
const {page} = await openPalette(browser, {language: "en"});
test.after(() => page.close());
await page.evaluate(() => {
Object.assign(window.fixture.model.installed[2], {self: true, name: "Community Store"});
window.fixture.publish();
});
const rows = page.locator("#installed-body tr");
assert.deepEqual(await rows.evaluateAll(items => items.map(item => item.dataset.row)),
["app-store", "panel", "linked"]);
for (const width of [900, 400]) {
await page.setViewportSize({width, height: 680});
const divider = width > 570 ? rows.first().locator("td").first() : rows.first();
assert.equal(await divider.evaluate(el => getComputedStyle(el).borderBottomWidth), "3px");
}
await page.locator("#updates-only").check();
assert.deepEqual(await rows.evaluateAll(items => items.map(item => item.dataset.row)), ["app-store", "panel"]);
await page.locator("#search").fill("No matching plugin");
assert.equal(await rows.count(), 1);
assert.equal(await rows.first().getAttribute("data-row"), "app-store");
assert(await page.locator("#installed-empty").isVisible());
});

await suite.test("a hung state read is retried and its late response is ignored", async (test) => {
const {page, errors} = await openPalette(browser, {language: "en", hangFirstState: true});
test.after(() => page.close());
Expand Down
Loading