The last couple of days, Claude has been busy adding functionality! There have been some small usability improvements, but another major agentic editing update. We'll call this v0.31.
Usability updates
As humbug has evolved, the use of menus for things has become less and less interesting. Instead it has evolved to allow common operations to be triggered via the on-screen UI. One thing I often find myself doing is wanting to switch between mindspaces.
To make this simpler, the mindspace label has now become a button. Clicking it lets you select a new mindspace.
I also noticed that when we did agentic edits in an editor tab the cursor was left where it was, but it should really move to immediately after the last hunk applied. It now does this.
Lastly, when saving a file the editor file watcher used to trigger a reload and thus move the cursor. Reloads are now suspended during a save operation.
Diff applying tools
The editor diff applying tool proved very powerful and is great for interactive work between the user and an AI, but this did mean opening the UI to do edits all the time. It occurred to me that being able to apply diffs in the filesystem tool was probably a good bet too.
To make this happen I had Claude refactor out the common elements into src/diff and also had it write tests in tests/diff. The new code then got applied to the editor tool and used for the filesystem tool.
One interesting difference is that as the filesystem tool will automatically save the diff and this requires a user approval, we added a "dry run" flag to allow a candidate diff to be tried before needing to commit to writing the file. This isn't necessary for the editor version as the edits don't need user approval, only the save operations do.
Humbug v0.31
I want to get the updated agentic edit features out, so this is Humbug v0.31.
New features:
- When the AI applies changes to an editor tab, the cursor position is now moved to immediately after the last line that has been edited.
- Replaced the mindspace label with a button that allows the user to open a new mindspace by clicking it.
- Refactored diff application logic into a reusable
diffpackage with abstract base classes for parsing, fuzzy matching, and applying unified diffs to various document types. - Added
apply_diffoperation to the filesystem AI tool, allowing the AI to apply unified diffs directly to files with fuzzy matching, overlap detection, dry-run validation, line ending preservation, and atomic file writes. - Editor diff applier now uses the shared diff package, reducing code duplication while maintaining Qt-specific functionality.
- When the editor tab diff applier runs on another tab that is not currently visible then the tab label will turn purple in the same way as conversation and preview tabs.
Bug fixes:
- Disabled file watching when saving files in the editor to avoid unecessary file reloads.