diff --git a/modules/shell/scripts/e2e_window.py b/modules/shell/scripts/e2e_window.py index 45e991a7..ff8444f3 100644 --- a/modules/shell/scripts/e2e_window.py +++ b/modules/shell/scripts/e2e_window.py @@ -6655,6 +6655,11 @@ def add(kind, name, address): check("checked, the destination is listed: its name, its kind, its address as its host and the end of its path", kept and "#équipe" in row and "Slack" in row and "hooks.example" in row and secret not in row and secret[-4:] in row, row) check("the address field is emptied once kept", browser.find_element(By.ID, "destination-address").get_attribute("value") == "") + # Said once the page is drawn again, by its name, never its address (#1333's rewrite of the announcement, nora's m10). + added = wait_for(browser, lambda b: b.execute_script("return document.getElementById('destination-said')?.textContent") == "Destination #équipe ajoutée.", 5) + check("kept: « Destination #équipe ajoutée. » said under the form, never the address", + added and secret not in browser.execute_script("return document.getElementById('destination-said')?.textContent ?? ''"), + browser.execute_script("return document.getElementById('destination-said')?.textContent")) # For an eye (lina's): the card with one destination, at the two widths, in both looks. for width in (1100, 420): browser.set_window_size(width, 800) @@ -8419,6 +8424,171 @@ def page_estimate(now: dt.datetime) -> None: (WORK / "fail-minutes").unlink(missing_ok=True) +def channel_added_from_page(now: dt.datetime) -> None: + """DB. D121, criterion 2: with no channel set up, « Partager » offers « Ajouter un canal », which opens the channel's + form — Settings' own, its kind, its name, its address — in a sheet of the page, a modal dialog (D120), never + Settings; Escape closes it, nothing kept; a channel added there is said, kept in the settings, and « Partager » + then sends to it. French light, English dark; axe with the sheet open.""" + print("DB. « Partager » with no channel: « Ajouter un canal », Settings' form in a sheet of the page (D121)") + meetings = WORK / "channel-from-page" + folder = meetings / "2026-11-25_10-00" + # A meeting with no summary yet: « Envoyer… » has nothing to send, and says so (D67, nora's remark on #1333). + bare = meetings / "2026-11-26_09-00" + session(bare, now - dt.timedelta(hours=6), 20, {"local.wav": 1000}) + session(folder, now - dt.timedelta(days=1), 20, {"local.wav": 1000}) + (folder / "minutes.md").write_text( + "---\ncontract: minutes/v3\nmade: 2026-11-25T10:30:00+01:00\nprovider: local\nmodel: qwen3:8b\ncontext: null\n---\n\n" + "## 1.\n\nLe devis est validé.\n\n## 2.\n\n- Rien\n\n## 3.\n\n- Rien\n") + good = "https://hooks.example/services/T00/B00/made-up-secret-ca" + menu = ("const m = document.getElementById('share-menu'); if (!m || m.hidden || !m.getClientRects().length) return null;" + " return [...m.querySelectorAll('[role=menuitem]')].map((i) => [i.id, i.textContent.trim()])") + sheet = ("const d = document.querySelector('dialog[open]'); if (!d) return null;" + " return {modal: d.matches(':modal'), title: d.querySelector('h2')?.textContent ?? '', labelled: d.getAttribute('aria-labelledby')," + " kinds: [...d.querySelectorAll('[role=radiogroup] input[type=radio]')].map((i) => i.value)," + " name: !!d.querySelector('input[type=text]'), address: !!d.querySelector('input[type=url]')," + " focused: document.activeElement && d.contains(document.activeElement) ? document.activeElement.getAttribute('type') : null," + " settings: !!document.querySelector('#settings:not([hidden])') && document.getElementById('settings').getClientRects().length > 0}") + for language, theme, words in ( + ("fr_FR.UTF-8", "light", {"add": "Ajouter un canal", "send": "Envoyer…", "button": "Ajouter", "added": "Destination Équipe produit ajoutée.", + "nothing": "Rien à envoyer\u00a0: le compte rendu n’est pas encore rédigé.", "unread": "Les canaux d’envoi ne sont pas encore lus."}), + ("en_US.UTF-8", "dark", {"add": "Add a channel", "send": "Send…", "button": "Add", "added": "Destination Équipe produit added.", + "nothing": "Nothing to send: the summary is not written yet.", "unread": "The channels to send to are not read yet."}), + ): + short = language[:2] + window = Window(meetings, language, "reminder = false\n") + window.env.update(GTK_THEME="Adwaita:dark" if theme == "dark" else "Adwaita") + with window as browser: + browser.set_window_size(1100, 800) + browser.execute_script(f"location.hash = '#/meeting/{folder.name}'") + wait_for(browser, lambda b: b.find_elements(By.ID, "share-open"), 10) + time.sleep(0.6) + # Pressed before the channels are read: said, never silent (D67); once read, the sheet. `sending_of` held 800 ms + # by a double of invoke (ines's, #1400), `__late` proving the wait happened. + browser.execute_script( + "const t = window.__TAURI__, core = t.core; window.__tauri = t; window.__late = 0;" + " const late = Object.assign(Object.create(Object.getPrototypeOf(core)), core, { invoke: (asked, rest, options) =>" + " asked === 'sending_of'" + " ? new Promise((done) => setTimeout(() => (window.__late++, done(core.invoke(asked, rest, options))), 800))" + " : core.invoke(asked, rest, options) });" + " const top = Object.assign({}, t, { core: late }); try { window.__TAURI__ = top; } catch (x) {}" + " if (window.__TAURI__ !== top) Object.defineProperty(window, '__TAURI__', { configurable: true, writable: true, value: top });") + held = browser.execute_script("return window.__TAURI__ !== window.__tauri") + browser.execute_script("location.hash = '#/'") + browser.execute_script(f"location.hash = '#/meeting/{folder.name}'") + wait_for(browser, lambda b: b.execute_script("return document.getElementById('meeting').dataset.name") == folder.name + and b.find_elements(By.ID, "share-open"), 5) + press(browser, "share-open") + wait_for(browser, lambda b: b.execute_script(menu), 2) + press(browser, "share-send") + early = wait_for(browser, lambda b: b.execute_script("return document.getElementById('share-said')?.textContent") == words["unread"], 2) + early_got = browser.execute_script("return [document.getElementById('share-said')?.textContent, window.__late, !!document.querySelector('dialog[open]')]") + read = wait_for(browser, lambda b: b.execute_script("return window.__late") > 0, 3) + time.sleep(0.3) + press(browser, "share-open") + wait_for(browser, lambda b: b.execute_script(menu), 2) + press(browser, "share-send") + then = wait_for(browser, lambda b: b.execute_script(sheet), 3) + check(f"{short}: « Envoyer… » pressed before the channels are read says « {words['unread']} »; once read, the sheet (D67)", + held and early and early_got[1] == 0 and early_got[2] is False and read and bool(then), [held, early_got, read, bool(then)]) + ActionChains(browser).send_keys(Keys.ESCAPE).perform() + shut = wait_for(browser, lambda b: not b.execute_script(sheet), 3) + browser.execute_script("Object.defineProperty(window, '__TAURI__', { configurable: true, writable: true, value: window.__tauri })") + # Asserted, never assumed: a sheet left open blocks every click after it (nora's m11 on #1333). + check(f"{short}: Escape closes the channel's sheet", shut, browser.execute_script(sheet)) + if not shut: + continue + time.sleep(0.3) + press(browser, "share-open") + items = wait_for(browser, lambda b: b.execute_script(menu), 3) and browser.execute_script(menu) + check(f"{short}: no channel, « Partager » offers « {words['add']} », never a send to nowhere (D121)", + bool(items) and [said for _, said in items].count(words["add"]) == 1 and words["send"] not in [said for _, said in items], items) + plus = browser.execute_script("const i = [...document.querySelectorAll('#share-menu [role=menuitem]')].find((e) => e.textContent.trim() === arguments[0]);" + " return i ? !!i.querySelector('svg') : null", words["add"]) + check(f"{short}: « {words['add']} » begins with its « + », as v5 draws it (l. 728)", plus is True, plus) + target = next((i for i, said in (items or []) if said == words["add"]), "share-send") + press(browser, target) + opened = wait_for(browser, lambda b: b.execute_script(sheet), 3) + got = browser.execute_script(sheet) or {} + check(f"{short}: a sheet of the page, modal, titled « {words['add']} », Settings' form in it — its kind, its name, its address —, the focus in it, Settings not opened", + bool(opened) and got.get("modal") is True and got.get("title") == words["add"] and got.get("labelled") + and got.get("kinds") == ["webhook", "discord", "slack"] and got.get("name") and got.get("address") + and got.get("focused") is not None and got.get("settings") is False, got) + # The audit of #1333 against v5: room under the sheet's lead, and Tab going round it (roundTheDialog, WAI-ARIA APG). + gap = browser.execute_script("const d = document.querySelector('dialog[open]'), p = d.querySelector(':scope > p.says'), f = d.querySelector('.adding');" + " return p && f ? f.getBoundingClientRect().top - p.getBoundingClientRect().bottom : null") + check(f"{short}: the sheet's lead has room under it, 8 px at least before the form", gap is not None and gap >= 8, gap) + stops = ("const d = document.querySelector('dialog[open]'); const s = [...d.querySelectorAll('button, input, select, textarea, a[href], [tabindex]:not([tabindex=\"-1\"])')]" + ".filter((e) => !e.disabled && e.getClientRects().length && !(e.type === 'radio' && !e.checked)); return s") + browser.execute_script("const s = (() => { " + stops + " })(); s[s.length - 1].focus()") + ActionChains(browser).send_keys(Keys.TAB).perform() + first = browser.execute_script("const s = (() => { " + stops + " })(); return document.activeElement === s[0]") + ActionChains(browser).key_down(Keys.SHIFT).send_keys(Keys.TAB).key_up(Keys.SHIFT).perform() + last = browser.execute_script("const s = (() => { " + stops + " })(); return document.activeElement === s[s.length - 1]") + check(f"{short}: Tab goes round the sheet: past its last control, its first; before its first, its last", first is True and last is True, [first, last]) + # Measured once the sheet's pop has ended (D120's animation): mid-way, its text is faded and axe reads a contrast + # the sheet never has at rest (the full run of #1333 at 03ea16f6, 5 shards side by side). An endless one is not waited for. + browser.execute_async_script("const done = arguments[arguments.length - 1]; Promise.all(document.getAnimations()" + ".filter((a) => a.effect?.getTiming().iterations !== Infinity).map((a) => a.finished)).then(() => done(true), () => done(false))") + found = axe_violations(browser) + check(f"{short}, {theme}: the sheet open, no violation of axe's WCAG 2.2 A and AA rules", found == [], found) + shot_themed(browser, f"db-sheet-{short}-{theme}", theme) + ActionChains(browser).send_keys(Keys.ESCAPE).perform() + closed = wait_for(browser, lambda b: b.execute_script(sheet) is None, 3) + check(f"{short}: Escape closes the sheet, nothing kept, the focus back on « Partager »", + closed and "destinations" not in window.file.read_text() and browser.execute_script("return document.activeElement?.id") == "share-open", + [closed, browser.execute_script("return document.activeElement?.id")]) + # At 420 px (the audit of #1333): the sheet within the window, its three kinds wrapping, nothing cut. + browser.set_window_size(420, 800) + wait_for(browser, lambda b: b.execute_script("return innerWidth") <= 440, 3) + press(browser, "share-open") + wait_for(browser, lambda b: b.execute_script(menu), 3) + press(browser, target) + wait_for(browser, lambda b: b.execute_script(sheet), 3) + fits = browser.execute_script("const d = document.querySelector('dialog[open]'), r = d.getBoundingClientRect();" + " return [r.left >= 0, r.right <= innerWidth + 0.5, d.scrollWidth <= d.clientWidth + 1," + " [...d.querySelectorAll('.tile')].every((t) => t.getBoundingClientRect().right <= r.right + 0.5)]") + check(f"{short}: at 420 px, the sheet within the window, its kinds and fields uncut, nothing scrolls sideways", fits == [True, True, True, True], fits) + # Shot once the sheet's pop has ended (D120's animation): mid-way, the page shows through it. + browser.execute_async_script("const done = arguments[arguments.length - 1]; Promise.all(document.getAnimations().map((a) => a.finished)).then(() => done(true), () => done(false))") + shot_themed(browser, f"db-sheet-420-{short}-{theme}", theme) + ActionChains(browser).send_keys(Keys.ESCAPE).perform() + wait_for(browser, lambda b: b.execute_script(sheet) is None, 3) + browser.set_window_size(1100, 800) + time.sleep(0.4) + press(browser, "share-open") + wait_for(browser, lambda b: b.execute_script(menu), 3) + press(browser, target) + wait_for(browser, lambda b: b.execute_script(sheet), 3) + browser.execute_script( + "const d = document.querySelector('dialog[open]'); const set = (e, v) => { e.value = v; e.dispatchEvent(new Event('input', {bubbles: true})); };" + " set(d.querySelector('input[type=text]'), 'Équipe produit'); set(d.querySelector('input[type=url]'), arguments[0]);", good) + browser.execute_script("const d = document.querySelector('dialog[open]'); [...d.querySelectorAll('button')].find((b) => b.textContent.trim() === arguments[0]).click()", words["button"]) + kept = wait_for(browser, lambda b: b.execute_script(sheet) is None and "Équipe produit" in window.file.read_text(), 10) + # Said once `refresh()` has answered, after the file is written: waited for, never read at once (nora on #1333). + statuses = "return [...document.querySelectorAll('[role=status]')].map((e) => e.textContent.trim()).filter(Boolean)" + wait_for(browser, lambda b: words["added"] in b.execute_script(statuses), 5) + said = browser.execute_script(statuses) + check(f"{short}: a channel added in the sheet: kept in the settings, the sheet closed, said once (#1252)", + kept and said.count(words["added"]) == 1 and good not in " ".join(said), said) + time.sleep(0.6) + press(browser, "share-open") + items = wait_for(browser, lambda b: b.execute_script(menu), 3) and browser.execute_script(menu) + check(f"{short}: then « Partager » sends to it, « {words['add']} » no longer offered", + bool(items) and words["add"] not in [said for _, said in items] and any(said.startswith(words["send"][:-1]) for _, said in items), items) + ActionChains(browser).send_keys(Keys.ESCAPE).perform() + # A channel set up, no summary yet: « Envoyer… » pressed is never silent (D67), said beside « Partager ». + browser.execute_script(f"location.hash = '#/meeting/{bare.name}'") + wait_for(browser, lambda b: b.execute_script("return document.getElementById('meeting').dataset.name") == bare.name + and b.find_elements(By.ID, "share-open"), 10) + time.sleep(0.6) + press(browser, "share-open") + wait_for(browser, lambda b: b.execute_script(menu), 3) + press(browser, "share-send") + nothing = wait_for(browser, lambda b: b.execute_script("return document.getElementById('share-said')?.textContent") == words["nothing"], 3) + check(f"{short}: a channel, no summary yet: « {words['send']} » says « {words['nothing']} », never silent (D67)", + nothing, browser.execute_script("return document.getElementById('share-said')?.textContent")) + + def meeting_actions_bar(now: dt.datetime) -> None: """MA. D121, criteria 1 and 6: a meeting's page holds one bar of actions — « Partager », « Agenda (n) » once a date is found, « Refaire » and « Plus » —, each its words and its icon, its accessible name beginning with its words @@ -11445,8 +11615,9 @@ def options(got: dict, group: str) -> list: browser.execute_script("document.activeElement?.blur()") opened(browser) got = typed(browser, "partager") - check("on a meeting, « partager »: « Partager » and its items listed (« Envoyer… »)", - any("Envoyer…" in o for o in options(got, "Actions")), got.get("groups")) + # No channel set up here: « Partager »'s send is « Ajouter un canal » (D121, #1333), as its menu holds it. + check("on a meeting with no channel, « partager »: « Partager » and its items listed (« Ajouter un canal », no « Envoyer… »)", + any("Ajouter un canal" in o for o in options(got, "Actions")) and not any("Envoyer…" in o for o in options(got, "Actions")), got.get("groups")) got = typed(browser, "refaire") check("« refaire »: « Refaire »'s items listed", len(options(got, "Actions")) >= 1, got.get("groups")) got = typed(browser, "copier le compte") @@ -18811,6 +18982,7 @@ def aside(folder): settings_tabbed(now) focus_swept(now) meeting_actions_bar(now) + channel_added_from_page(now) meeting_exported(now) redo_from_the_bar(now) meeting_trashed(now) diff --git a/modules/shell/src/words.rs b/modules/shell/src/words.rs index 85cd94f5..30cb5c2a 100644 --- a/modules/shell/src/words.rs +++ b/modules/shell/src/words.rs @@ -652,6 +652,10 @@ pub struct Window { /// and its files. Shows: a meeting's page, the bar of actions, a button. When: always. At most: about 12 /// characters. Placeholders: none. pub meeting_share: &'static str, + /// D121, criterion 2: « Partager » with no channel set up, and the title of the sheet that adds one, Settings' form + /// in it. Shows: a meeting's page, « Partager »'s menu, an item; the sheet's title. When: no channel is set up. + /// At most: about 24 characters. Placeholders: none. + pub channel_add: &'static str, /// D121, « Partager »'s export of the summary alone as a PDF, written where the user chooses in the system's /// dialog. Shows: a meeting's page, « Partager »'s menu, an item. When: always. At most: about 24 characters. /// Placeholders: none. @@ -1049,6 +1053,13 @@ pub struct Window { /// The button that opens the send panel (D110). Shows: a meeting's page, the summary's actions. When: a /// summary, a destination set up, the meeting not confidential. At most: one word. Placeholders: none. pub send_open: &'static str, + /// Said beside « Partager » when its « Envoyer… » has nothing to send (D67, #1333). Shows: a meeting's page, under + /// the bar. When: a channel set up, no summary yet. At most: one sentence. Placeholders: none. + pub send_nothing: &'static str, + /// Said beside « Partager » when its « Envoyer… » is pressed before the channels are read, or when they could not be + /// (D67, #1333). Shows: a meeting's page, under the bar. When: `sending_of` not answered. At most: one sentence. + /// Placeholders: none. + pub send_unread: &'static str, /// Each destination's button in the send panel (PDR-0007 §2). Shows: a meeting's page, the send panel. When: /// the panel is open. At most: four words. Placeholders: {} the destination's name. pub send_to: &'static str, @@ -2304,6 +2315,7 @@ pub fn window(language: Language) -> Window { ], more_actions: "More actions", meeting_share: "Share", + channel_add: "Add a channel", export_pdf: "Export to PDF", export_md: "Export to Markdown", export_done: "Exported: “{}”.", @@ -2447,6 +2459,8 @@ pub fn window(language: Language) -> Window { destination_added: "Destination {} added.", destination_not_added: "Destination not added: {}", send_open: "Send…", + send_nothing: "Nothing to send: the summary is not written yet.", + send_unread: "The channels to send to are not read yet.", send_to: "Send to “{}”", send_notice: "The title, the summary and its actions go to “{}”. Never the audio, never the transcript. A summary sent cannot be taken back.", send_confidential_ask: "This meeting is confidential: its summary will leave this computer for “{}”.", @@ -2917,6 +2931,7 @@ pub fn window(language: Language) -> Window { ], more_actions: "Plus d’actions", meeting_share: "Partager", + channel_add: "Ajouter un canal", export_pdf: "Exporter en PDF", export_md: "Exporter en Markdown", export_done: "Exporté\u{a0}: «\u{a0}{}\u{a0}».", @@ -3068,6 +3083,8 @@ pub fn window(language: Language) -> Window { destination_added: "Destination {} ajoutée.", destination_not_added: "Destination non ajoutée\u{a0}: {}", send_open: "Envoyer…", + send_nothing: "Rien à envoyer\u{a0}: le compte rendu n’est pas encore rédigé.", + send_unread: "Les canaux d’envoi ne sont pas encore lus.", send_to: "Envoyer à « {} »", send_notice: "Le titre, le compte rendu et ses actions partent vers « {} ». Jamais le son, jamais la transcription. Un compte rendu envoyé ne peut pas être repris.", send_confidential_ask: "Cette réunion est confidentielle\u{a0}: son compte rendu va quitter cet ordinateur pour «\u{a0}{}\u{a0}».", diff --git a/modules/shell/ui/window.css b/modules/shell/ui/window.css index 1ab8e33b..4b5ce982 100644 --- a/modules/shell/ui/window.css +++ b/modules/shell/ui/window.css @@ -830,6 +830,9 @@ body.small-window .check-sound { inset: 0 auto auto 0; width: 100%; max-width: 1 .with-mark select { flex: 1 1 auto; min-width: 0; } /* A summary's section with nothing in it (#1234): said, in the soft colour. */ .minutes .body .empty-section { color: var(--soft); } +/* « Ajouter un canal »'s sheet (D121, #1333): room under its lead before the form; a menu item's icon before its words. */ +.dialog.sheet > .says { margin-bottom: var(--sp-3); } +.menu-item > .glyph { flex: none; width: var(--sp-4); height: var(--sp-4); margin-right: var(--sp-2); } /* D128a: the sheet of the window's shortcuts (« ? »), each row its keys then what they do. */ .keys-table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); } diff --git a/modules/shell/ui/window.js b/modules/shell/ui/window.js index cd447c2b..33c576d7 100644 --- a/modules/shell/ui/window.js +++ b/modules/shell/ui/window.js @@ -96,6 +96,7 @@ function lock() { const ICONS = { calendar: ["M8 2v4", "M16 2v4", ["rect", { width: 18, height: 18, x: 3, y: 4, rx: 2 }], "M3 10h18"], check: ["M20 6 9 17l-5-5"], + plus: ["M5 12h14", "M12 5v14"], "chevron-left": ["m15 18-6-6 6-6"], "chevron-down": ["m6 9 6 6 6-6"], "chevron-up": ["m18 15-6-6-6 6"], @@ -161,6 +162,120 @@ function icon(name) { return svg; } +// A destination's form (D110, D121): its kind a tile each, its name, its address, « Ajouter »; Settings' own and the +// meeting page's sheet's, each its own ids from `prefix`. `added(name)` runs once it is kept, and says it. +function destinationForm(words, locked, prefix, added) { + const kinds = { webhook: 0, discord: 1, slack: 2 }; + const adding = element("div", "fields adding"); + adding.id = `${prefix}-adding`; + // Its kind a tile each (#1238), as a desktop offers a few kinds: its mark or the page's icon, its name; a radio group + // the arrows move in, its first chosen at first, as the list's first was. + // On a whole line, as the address: the three tiles side by side. + const kindField = element("div", "field kinds whole"); + const kindName = element("span", "name", words.destination_fields[0]); + kindName.id = `${prefix}-kind-name`; + const tiles = element("div", "tiles"); + tiles.setAttribute("role", "radiogroup"); + tiles.setAttribute("aria-labelledby", kindName.id); + for (const [value, index] of Object.entries(kinds)) { + const tile = element("label", "tile"); + const input = element("input"); + input.type = "radio"; + input.name = `${prefix}-kind`; + input.value = value; + input.id = `${prefix}-kind-${value}`; + input.checked = index === 0; + input.disabled = locked; + tile.append(input, kindMark(value), element("span", "", words.destination_kinds[index])); + tiles.append(tile); + } + kindField.append(kindName, tiles); + const kind = { get value() { return tiles.querySelector("input:checked")?.value ?? "webhook"; }, focus: () => tiles.querySelector("input:checked")?.focus() }; + const [namedField, named] = guidedField(`${prefix}-name`, words.destination_fields[1], "text", "", locked); + named.maxLength = 40; + named.autocomplete = "off"; + const [addressField, address] = guidedField(`${prefix}-address`, words.destination_fields[2], "url", "", locked); + addressField.classList.add("whole"); + address.autocomplete = "off"; + address.spellcheck = false; + address.setAttribute("aria-describedby", `${prefix}-address-said`); + const addressSaid = element("p", "says", words.destination_address_said); + addressSaid.id = `${prefix}-address-said`; + const add = element("button", "open", words.destination_add); + add.type = "button"; + add.id = `${prefix}-add`; + add.disabled = locked; + const result = element("p", "says"); + result.id = `${prefix}-said`; + result.setAttribute("role", "status"); + add.addEventListener("click", () => { + add.disabled = true; + window.__TAURI__.core + .invoke("destination_added", { kind: kind.value, name: named.value, address: address.value }) + .then( + () => { + // Kept: the address leaves the page at once; whoever opened the form says it. + const name = named.value.trim(); + address.value = ""; + return added(name); + }, + (why) => { + result.textContent = fill(words.destination_not_added, why); + add.disabled = locked; + }, + ); + }); + adding.append( + kindField, + namedField, + addressField, + addressSaid, + add, + result, + ); + return { adding, kind, result, add }; +} + +// « Ajouter un canal » (D121, criterion 2): Settings' channel form in a sheet of the meeting's page, the platform's modal +// `` (D120) — titled, the rest inert, Escape or « Annuler » closing it, nothing kept —, the focus on its first +// field and back where it was. A channel added closes it; the page, drawn again, sends to it, and says it once. +function channelSheet(words) { + const back = document.activeElement; + const dialog = element("dialog", "dialog sheet"); + const heading = element("h2", "", words.channel_add); + heading.id = "channel-sheet-title"; + dialog.setAttribute("aria-labelledby", heading.id); + const close = () => { + dialog.close(); + dialog.remove(); + if (back instanceof HTMLElement && back.isConnected) back.focus(); + }; + const { adding, kind, add } = destinationForm(words, false, "channel", (name) => { + close(); + return refresh().then(() => { + const said = document.getElementById("share-said"); + if (said) said.textContent = fill(words.destination_added, name); + document.getElementById("share-open")?.focus(); + }); + }); + const cancel = element("button", "button secondary", words.send_cancel); + cancel.type = "button"; + cancel.addEventListener("click", close); + // Its answers together, as the platform's dialogs and `ask()` put them: the safe one first, « Ajouter » the primary. + add.className = "button primary"; + const actions = element("div", "actions"); + actions.append(cancel, add); + dialog.append(heading, element("p", "says", words.destinations_said), adding, actions); + dialog.addEventListener("cancel", (event) => { + event.preventDefault(); + close(); + }); + document.body.append(dialog); + roundTheDialog(dialog); + dialog.showModal(); + kind.focus(); +} + // « Refaire le compte rendu » and « Refaire la transcription » (D121, criterion 3; no ellipsis, the voice guide D124): a dialog of the page (D120) with D122's // engine card for the meeting, its own choice checked — « Par défaut » being Settings' —, the panels' notes, « Annuler » // then a button naming the making, never an engine. Another engine chosen is kept for the meeting first, as Refaire… @@ -831,6 +946,8 @@ function confidentialCard(session, confidential, words) { // A session's folder name: what the window calls it, and the only date it says when its start // cannot be read. const nameOf = (session) => session.folder.split(/[\\/]/).pop(); +// Whether the meeting shown has no channel to send to (D121): « Partager »'s send then adds one. +let shareAddsChannel = false; // A sentence the shell told, begun with its capital where the page says it alone (« le fichier… » → « Le fichier… »). const sentenceOf = (told) => told.charAt(0).toUpperCase() + told.slice(1); @@ -2500,6 +2617,13 @@ function sendPart(card, top, actions, session, words) { if (!shown) return; listSends(shown); sayFailed(shown); + // No channel set up (D121): « Partager »'s send becomes « Ajouter un canal ». + shareAddsChannel = shown.destinations.length === 0; + if (shareAddsChannel) { + const item = document.getElementById("share-send"); + // Its « + » before its words, as v5 draws it (l. 728). + if (item) item.replaceChildren(icon("plus"), element("span", "", words.channel_add)); + } if (!shown.offered) return; let offered = shown.destinations; let secret = shown.confidential; @@ -3709,7 +3833,16 @@ function showMeeting({ session, transcript, minutes, developer, listen: listened shared.textContent = sentenceOf(String(why)); } }; - const share = moreActions([["share-send", words.send_open, press("send-open")], ["share-copy", words.copy_minutes, press("copy-minutes")], + // « Envoyer… » sends where a channel is set up; with none, the summary's card says so (`sending_of`) and the item + // becomes « Ajouter un canal », Settings' form in a sheet of the page (D121, criterion 2). + shareAddsChannel = false; + // Never silent (D67): with no summary yet, or before the channels are read (or when they could not be), said in place. + const shareSend = () => { + if (document.getElementById("send-open")) return press("send-open")(); + if (shareAddsChannel) return channelSheet(words); + shared.textContent = minutes.state === "present" ? words.send_unread : words.send_nothing; + }; + const share = moreActions([["share-send", words.send_open, shareSend], ["share-copy", words.copy_minutes, press("copy-minutes")], ["share-pdf", words.export_pdf, exportTo("pdf")], ["share-md", words.export_md, exportTo("md")]], words, { id: "share-open", menuId: "share-menu", glyph: "share-2", label: words.meeting_share, name: words.meeting_share, chevron: true }); // A confidential meeting is shared explicitly, and the menu says how (PDR-0007, amended 2026-11-24): its line heard @@ -4606,74 +4739,11 @@ function showSettings(shown, minutes, words, engines = null, services = { minute }); // The add form apart from the list, its fields the Settings' own (guidedField, guidedList); the // address on a whole line, long enough to read back what was pasted. - const adding = element("div", "fields adding"); - adding.id = "destination-adding"; - // Its kind a tile each (#1238), as a desktop offers a few kinds: its mark or the page's icon, its name; a radio group - // the arrows move in, its first chosen at first, as the list's first was. - // On a whole line, as the address: the three tiles side by side. - const kindField = element("div", "field kinds whole"); - const kindName = element("span", "name", words.destination_fields[0]); - kindName.id = "destination-kind-name"; - const tiles = element("div", "tiles"); - tiles.setAttribute("role", "radiogroup"); - tiles.setAttribute("aria-labelledby", "destination-kind-name"); - for (const [value, index] of Object.entries(kinds)) { - const tile = element("label", "tile"); - const input = element("input"); - input.type = "radio"; - input.name = "destination-kind"; - input.value = value; - input.id = `destination-kind-${value}`; - input.checked = index === 0; - input.disabled = locked; - tile.append(input, kindMark(value), element("span", "", words.destination_kinds[index])); - tiles.append(tile); - } - kindField.append(kindName, tiles); - const kind = { get value() { return tiles.querySelector("input:checked")?.value ?? "webhook"; }, focus: () => tiles.querySelector("input:checked")?.focus() }; - const [namedField, named] = guidedField("destination-name", words.destination_fields[1], "text", "", locked); - named.maxLength = 40; - named.autocomplete = "off"; - const [addressField, address] = guidedField("destination-address", words.destination_fields[2], "url", "", locked); - addressField.classList.add("whole"); - address.autocomplete = "off"; - address.spellcheck = false; - address.setAttribute("aria-describedby", "destination-address-said"); - const addressSaid = element("p", "says", words.destination_address_said); - addressSaid.id = "destination-address-said"; - const add = element("button", "open", words.destination_add); - add.type = "button"; - add.id = "destination-add"; - add.disabled = locked; - const result = element("p", "says"); - result.id = "destination-said"; - result.setAttribute("role", "status"); - add.addEventListener("click", () => { - add.disabled = true; - window.__TAURI__.core - .invoke("destination_added", { kind: kind.value, name: named.value, address: address.value }) - .then( - () => { - // Kept: the address leaves the page at once; the list, drawn again, names it. - address.value = ""; - return refresh().then(() => { - const said = document.getElementById("destination-said"); - if (said) said.textContent = fill(words.destination_added, named.value.trim()); - }); - }, - (why) => { - result.textContent = fill(words.destination_not_added, why); - add.disabled = locked; - }, - ); - }); - adding.append( - kindField, - namedField, - addressField, - addressSaid, - add, - result, + const { adding, kind } = destinationForm(words, locked, "destination", (name) => + refresh().then(() => { + const said = document.getElementById("destination-said"); + if (said) said.textContent = fill(words.destination_added, name); + }), ); // Folded at first: a disclosure (ARIA APG), as « Avancé »; unfolded by a click, the focus goes to // its first field. Escape does not fold it: a half-filled form is not lost by a key.