new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Electron · API · all subjects

notification/actions

3 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

button action type support and behavior

The 'button' action type is supported on macOS and Windows. The text property is used as the label for the button. On macOS, the default text is 'Show' (localized) if it is the first button, otherwise empty. Windows uses the provided text. On macOS, only the first button is used as primary; others are shown as additional actions when hovering. Button actions are incompatible with hasReply beyond the first button (others are ignored).

selection action type support and behavior

The 'selection' action type is supported on Windows only. The text property is used as the label for the submit button for the selection menu, with a default of 'Select'. A 'selection' action requires an items array property specifying option labels. When the user activates the selection action, the notification's action event is emitted with actionIndex (the action's index in the actions array) and selectedIndex (the zero-based index of the chosen item, or -1 if unavailable). On non-Windows platforms, selection actions are ignored.

NotificationAction selection example

Example creating a selection action in a notification: const { Notification, app } = require('electron') app.whenReady().then(() => { const items = ['One', 'Two', 'Three'] const n = new Notification({ title: 'Choose an option', actions: [{ type: 'selection', text: 'Apply', items }] }) n.on('action', (e) => { console.log(`User triggered action at index: ${e.actionIndex}`) if (e.selectionIndex > 0) { console.log(`User chose selection item '${items[e.selectionIndex]}'`) } }) n.show() }) This example shows how to create a selection-type action with labeled options and handle the action event to determine which option was selected.

Give your agent this brain