Project format updates

This commit is contained in:
Peter Willemsen
2026-11-30 17:25:03 +01:00
parent 563d1992a2
commit 4822a697bf
11 changed files with 425 additions and 111 deletions
+8 -4
View File
@@ -1,4 +1,4 @@
// A row always identifies a folder in the current group inventory. Private
// A row identifies a folder accessible through the current launch's grants. Private
// recents supply the activity order only, never the inventory or a grant.
export function mountOverview(target, {client, extensionName, text, locale, onImport}) {
const document = target.ownerDocument;
@@ -20,8 +20,12 @@ export function mountOverview(target, {client, extensionName, text, locale, onIm
const actions = element('div', '', 'isa-project-toolbar');
const refreshButton = button(text.refresh, refresh);
actions.append(refreshButton);
const pickFolder = button(text.pickFolder, () => run(async () => {
if (await client.pickFolder()) await refresh();
}));
if (client.supports('pickFolder')) actions.append(pickFolder);
const importButton = button(text.import, () => run(onImport));
if (onImport && client.supports('projects_create')) actions.append(importButton);
if (onImport && client.supports('create')) actions.append(importButton);
header.append(actions);
const grid = element('div', '', 'isa-group-grid');
const activity = element('aside');
@@ -35,7 +39,7 @@ export function mountOverview(target, {client, extensionName, text, locale, onIm
panelTitle.id = 'isa-projects-' + crypto.randomUUID();
panel.setAttribute('aria-labelledby',panelTitle.id);
heading.append(panelTitle);
if (client.supports('projects_create')) heading.append(create);
if (client.supports('create')) heading.append(create);
const controls = element('div', '', 'isa-project-toolbar');
const search = element('input');
search.type = 'search';
@@ -96,7 +100,7 @@ export function mountOverview(target, {client, extensionName, text, locale, onIm
}
}
if (!recent.childElementCount && !loading && !failed) recent.append(element('p',text.noActivity));
create.disabled = busy; importButton.disabled = busy; refreshButton.disabled = busy || loading;
pickFolder.disabled = busy; create.disabled = busy; importButton.disabled = busy; refreshButton.disabled = busy || loading;
}
async function refresh() {
const ticket = ++generation;