mirror of
https://github.com/karatektus/pl_mail.git
synced 2026-10-25 01:54:10 +00:00
Answer the a shortcut on a message with one recipient
Reported from the demo: r and f worked in an open conversation and a did not. The Reply-all link is only drawn for a message with more than one recipient, and a shortcut presses the control that is there, so on every other message a found nothing and did nothing. It falls back to Reply, as Gmail does. Every test fixture has a single recipient, which is why the specs for #36 never met a Reply-all link either way. Refs #36 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a7b4928bfd
commit
7c0cf33dfd
3 files changed
+29
-1
No files matched your search
@@ -17,6 +17,8 @@ while a dialog or menu is open. On for everyone; Settings → General → Keyboa
|
||||
them off per person. No migration.
|
||||
[#36](https://github.com/karatektus/pl_mail/issues/36).
|
||||
|
||||
`a` replies on a message that has only one recipient, where there is no Reply to all to press.
|
||||
|
||||
**A config backup now carries how each person sorts their mail.** Settings → Categories — rules or
|
||||
the assistant, whether that overrules the provider's own categories, and whether the inbox has tabs
|
||||
at all — was never written into the file, so a restore put everyone back on rules, the provider's
|
||||
|
||||
@@ -215,7 +215,14 @@ export default class extends Controller {
|
||||
case "b": return this.#act("snooze");
|
||||
|
||||
case "r": return this.#press(this.#reading()?.querySelector(OPEN.reply));
|
||||
case "a": return this.#press(this.#reading()?.querySelector(OPEN.replyAll));
|
||||
// Reply to all, and a plain reply where there is nobody else to
|
||||
// include. The Reply-all link is only drawn for a message with more
|
||||
// than one recipient, so on every other message `a` found no button
|
||||
// and did nothing — which reads as a broken key, not as "there is
|
||||
// only one person here". Gmail answers `a` with a reply there too.
|
||||
case "a": return this.#press(
|
||||
this.#reading()?.querySelector(OPEN.replyAll) ?? this.#reading()?.querySelector(OPEN.reply),
|
||||
);
|
||||
case "f": return this.#press(this.#reading()?.querySelector(OPEN.forward));
|
||||
|
||||
default: return false;
|
||||
|
||||
@@ -165,6 +165,25 @@ test.describe("keyboard shortcuts", () => {
|
||||
await expect(page.locator("turbo-frame#compose_dock form").first()).toBeVisible();
|
||||
});
|
||||
|
||||
/**
|
||||
* `a` answers on every message, not only on one with several recipients.
|
||||
*
|
||||
* Reported from the demo within a day: r and f worked and a did not. The
|
||||
* Reply-all link is only drawn when there is more than one recipient, and
|
||||
* `a` pressed a link that was not there. It replies instead, which is what
|
||||
* "all" comes to when all is one person.
|
||||
*/
|
||||
test("a replies even where there is nobody else to reply to", async ({ page }) => {
|
||||
await inbox(page);
|
||||
await mailRow(page, INBOX_SUBJECTS.read).click();
|
||||
|
||||
await expect(page.locator('[data-shortcut="reply"]')).toBeVisible();
|
||||
await expect(page.locator('[data-shortcut="reply-all"]'), "this fixture has one recipient").toHaveCount(0);
|
||||
|
||||
await page.keyboard.press("a");
|
||||
await expect(page.locator(".compose-window").first()).toBeVisible();
|
||||
});
|
||||
|
||||
test("switched off, a key is only a key", async ({ page }) => {
|
||||
await setShortcuts(page, "Off");
|
||||
|
||||
|
||||
Reference in new issue
Block a user