breaking_changes_notice
This directory contains a utility plugin designed to monitor the repository's BREAKING_CHANGES.txt file and notify the user whenever it updates. This ensures that users are immediately aware of any changes that might break their existing Talon configuration.
How It Works
The system operates using a background file watcher, an in-app GUI notification, and contextual voice commands that become active only when the notification is on-screen.
Core Logic
The backbone of this plugin is notice.py. When Talon starts, it performs the following lifecycle operations:
- Initialization (
on_ready): Registers a filesystem watcher on the targetBREAKING_CHANGES.txtfile (located two directories above this plugin) and triggers an initial check. - State Management: It tracks the previous file size of the breaking changes document. This state is saved using Talon's stored state actions (
actions.user.stored_state_*). - Change Detection: If the current file size differs from the previously recorded size, the plugin triggers an immediate notification using an on-screen IMGUI window (
notice_gui) and activates the context taguser.breaking_changes_notice_showing. - Permanent Dismissal: If a user chooses to never show the notice again, a signal file is written using the stored state module to suppress all future notifications.
Voice Commands and Context
The voice commands are split into global and context-sensitive files:
- Global Access: breaking_changes_global.talon is always active. It allows the user to say
"read breaking changes"at any time to open the documentation file in their default text editor using theuser.edit_text_fileaction. - Contextual Actions: breaking_changes_notice_showing.talon is activated only when the IMGUI notification is visible (by matching the
user.breaking_changes_notice_showingtag). It exposes two voice commands to manage the active dialog:"breaking hide": Temporarily hides the current warning."breaking dismiss": Hides the warning and writes a state file to prevent the notification from ever appearing again.