Skip to content

Refactor TODONT module with configurable hotkey and bulk archive #16

@salmonumbrella

Description

@salmonumbrella

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions