Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: build/test/**/*.junit.xml
files: build/test/result.junit.xml

- name: Bundle
run: corepack yarn build-js
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ jobs:
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: build/test/**/*.junit.xml
files: build/test/result.junit.xml
2 changes: 1 addition & 1 deletion ext/options.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ input {
height: 100%;

&[type="number"] {
text-align: var(--align-end);
text-align: right;
Comment thread
snipsnipsnip marked this conversation as resolved.
}
&[type="reset"] {
height: var(--in-content-button-height);
Expand Down
3 changes: 2 additions & 1 deletion ext/options.nolint.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
/* @see https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Internationalization#predefined_messages */
:root {
--direction: __MSG_@@bidi_dir__;
--align-start: __MSG_@@bidi_start_edge__;
--align-end: __MSG_@@bidi_end_edge__;
}
}
11 changes: 6 additions & 5 deletions src/ghosttext-adaptor/email_editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@ export class EmailEditor implements IClientEditor, IStatusIndicator {
private readonly options: ClientOptions,
) {}

update(status: ClientStatus): Promise<void> {
async update(status: ClientStatus): Promise<void> {
const icon = imageForStatus(status)
const isNewStatus = status !== (this.lastStatus ?? "inactive")

if (status !== (this.lastStatus ?? "inactive")) {
this.notificationTray.showNotification(icon, messageForStatus(status))
}
this.lastStatus = status

return this.composeWindow.setIcon(icon)
await Promise.all([
isNewStatus && this.notificationTray.showNotification(icon, messageForStatus(status)),
this.composeWindow.setIcon(icon),
])
}

async getState(): Promise<EmailState> {
Expand Down
12 changes: 11 additions & 1 deletion src/thunderbird/background_util/notification_tray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ import type { INotificationTray } from "src/ghosttext-adaptor"
import type { MessageId } from "src/util"
import type { ManifestInfo } from "."

/** Wraps the Notification API */
export class NotificationTray implements INotificationTray {
static isSingleton = true

/** Maximum number of notifications to show simultaneously */
private readonly slotCount = 5
private lastId = 0
private title: string | undefined

constructor(
Expand All @@ -13,7 +17,8 @@ export class NotificationTray implements INotificationTray {
) {}

async showNotification(iconUrl: string, messageId: MessageId): Promise<void> {
await this.messenger.notifications.create(this.makeNotification(iconUrl, messageId))
const opts = this.makeNotification(iconUrl, messageId)
await this.messenger.notifications.create(this.makeId(), opts)
}

private makeNotification(iconUrl: string, messageId: MessageId): messenger.notifications.CreateNotificationOptions {
Expand All @@ -25,4 +30,9 @@ export class NotificationTray implements INotificationTray {
message: this.messenger.i18n.getMessage(messageId),
}
}

private makeId(): string {
this.lastId = (this.lastId + 1) % this.slotCount
return `NotificationTray-${this.lastId}`
}
}
14 changes: 13 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,31 @@
"favicon": "ext/blue.svg",
"router": "structure",
"searchInDocuments": true,
"readme": "none",
"githubPages": false,
"customJs": "doc/res/typedoc.cjs",
"excludePrivate": false,
"includeHierarchySummary": false,
"excludeReferences": true,
"modifierTags": [
"@file"
],
"sluggerConfiguration": {
"lowercase": true
},
"ignoredHighlightLanguages": [
"mermaid"
],
"entryPoints": [
"./src/*/*/index.ts",
"./src/*/index.ts"
],
"projectDocuments": [
"doc/*.md",
"ext/*.md",
"CONTRIBUTING.md",
"BUILDING.md"
"BUILDING.md",
"README.md"
],
"plugin": [
"typedoc-plugin-mdn-links"
Expand Down