Skip to content

diff: the focus hook answers to either name the engine stamps on its elements - #96953

Merged
poteat merged 1 commit into
mainfrom
poteat/diff-focus-names
Sep 25, 2026
Merged

poteat merged 1 commit into
mainfrom
poteat/diff-focus-names

Conversation

@poteat

@poteat poteat commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

The mod's ui.focus hook matched the elements it drew through its own name, one constant ({ plugin: Names.PLUGIN_NAME }, 'diff'). The engine stamps an element with the name the plugin is registered under, and a build that carries this mod registers it as cc-plugin-diff. With a single name in the matcher the hook would stop seeing its own elements there, and silently: the inline file list would no longer follow the focus ring, and nothing would say why.

A matcher takes an array as any-of, so the constant is now the two names, PLUGIN_NAMES = ['diff', 'cc-plugin-diff']. Loaded from this folder (--plugin-dir, claude plugin test) the mod is diff, as its manifest says, and nothing changes. The addresses the tests press ($.ui.press({ plugin: 'diff', ... })) are resolved against that manifest name, so they stay as they are.

Checked:

  • mods/diff/tests/views.test.ts: a new case, "the walk follows under the name a build registers", raises the same walk with the focus stamped cc-plugin-diff and expects the same recentring. With the matcher put back to the single name, that case is the one that fails (157 pass, 1 fail).
  • Against a current build, at this branch's head: the mods' typecheck passes and claude plugin test mods/diff passes 158 of 158.

@poteat
poteat merged commit c948155 into main Sep 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants