Problem
The TODONT/Archive module has several limitations:
- The Archive hotkey (Cmd/Ctrl+Shift+Enter) is hardcoded with no way to customize it
- Archiving doesn't work on multi-selected blocks
- The ARCHIVED button styling replaces the button's inner text, which breaks accessibility (screen readers see "x" instead of "ARCHIVED")
- The module uses a raw keydown listener instead of Roam's command palette, so it doesn't appear in the command search
- Missing null-safety guards in
replaceText and mobile icon handlers
Proposed Changes
- Accept
extensionAPI parameter in initializeTodont, return { toggle, cleanup } for proper lifecycle management
- Register Archive command via
extensionAPI.ui.commandPalette.addCommand with configurable default hotkey
- Add
archiveBlock helper using updateBlock for multi-select support
- Use CSS
::before pseudo-element for ARCHIVED button styling (keeps text as "ARCHIVED" for accessibility)
- Replace
styleArchivedButtons with syncArchivedButton/syncArchivedButtons pattern
- Add null-safety guards and proper cleanup on extension unload
Problem
The TODONT/Archive module has several limitations:
replaceTextand mobile icon handlersProposed Changes
extensionAPIparameter ininitializeTodont, return{ toggle, cleanup }for proper lifecycle managementextensionAPI.ui.commandPalette.addCommandwith configurable default hotkeyarchiveBlockhelper usingupdateBlockfor multi-select support::beforepseudo-element for ARCHIVED button styling (keeps text as "ARCHIVED" for accessibility)styleArchivedButtonswithsyncArchivedButton/syncArchivedButtonspattern