Skip to content

Updated element IDs for new Fastmail layout#70

Merged
joelekstrom merged 1 commit intojoelekstrom:masterfrom
kalkwarf:keyhandler-updates
Feb 8, 2022
Merged

Updated element IDs for new Fastmail layout#70
joelekstrom merged 1 commit intojoelekstrom:masterfrom
kalkwarf:keyhandler-updates

Conversation

@kalkwarf
Copy link
Copy Markdown
Contributor

@kalkwarf kalkwarf commented Feb 6, 2022

The DOM changed with the latest UI refresh, so I updated the handlers to look for the new IDs.

A: This is fragile. There must be a better way.
B: The fact that we assure the document looks like we expected means we failed safely, so there's that.

@joelekstrom
Copy link
Copy Markdown
Owner

joelekstrom commented Feb 7, 2022

Hi! Thanks for the patch.

I think a better way may be to check the current URL perhaps? For example, when viewing a mail,
it looks something like this: https://www.fastmail.com/mail/Inbox/{mail-id}, but when replying to one, it's https://www.fastmail.com/mail/Inbox/compose/{mail-id}. Would this give you enough safety checks to know when to run the shortcuts?

@joelekstrom
Copy link
Copy Markdown
Owner

Another idea is to somehow override the Fastmail bindings. In their source code they have this inside mail.mod.js:

    Uo = {
        r: "reply",
        a: "replyAll",
        "Alt-r": "replySender",
        f: "forward",
        n: "goNext",
        p: "goPrevious",
        e: "toggleExpand",
        s: "toggleFlagged",
        '"': "toggleQuotes",
        ":": "toggleDetails",
        ";": "showActions",
        "Shift-E": "expandAll",
        "Alt-Shift-E": "collapseAll",
        "Shift-L": "showRemoteImages",
        "Cmd-a": "selectMessageBody"
    },

perhaps one could extend it and simply add the arrow shortcuts there. But I think the URL approach is simpler

@joelekstrom joelekstrom merged commit 735df19 into joelekstrom:master Feb 8, 2022
joelekstrom added a commit that referenced this pull request Aug 8, 2022
* In-app download support #82
Fastmate now downloads directly to a folder (which can be changed in settings) instead of opening an external browser. The old behavior can still be enabled in settings.
* Add basic AppleScript support #81
* Add support for opening Fastmail https:// links #88
* Fix some shortcuts not working with new Fastmail layout #70

Big thanks to @mdbraber for all the work on these new features!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants