Skip to content

Put the fix next to the doctor's diagnosis - #2133

Merged
bbatsov merged 1 commit into
masterfrom
feature/actionable-findings
Jul 28, 2026
Merged

Put the fix next to the doctor's diagnosis#2133
bbatsov merged 1 commit into
masterfrom
feature/actionable-findings

Conversation

@bbatsov

@bbatsov bbatsov commented Jul 28, 2026

Copy link
Copy Markdown
Owner

The last idea from the prior-art dig in #2132. Flycheck's verify-setup renders
a disabled checker as (manually disabled) [enable] - the fix sits next to the
diagnosis instead of being described in a sentence. The doctor was doing the
sentence version.

Findings become plists rather than (SEVERITY . MESSAGE) conses, so one can
carry an action and a label. Four of them can be acted on:

  • projectile-mode is off -> [enable]
  • large project with caching disabled -> [enable caching]
  • dirconfig with prefix-less lines, or + keep entries -> [open dirconfig]
  • project type not detected -> [edit .dir-locals.el]

Pressing one runs it and regenerates the report, so the finding that prompted
the action visibly answers for itself. Findings Projectile can't do anything
about - a missing fd, a missing rg - deliberately stay plain advice rather
than growing a button that would only explain.

Two things came out of looking at it rendered rather than just tested:

  • The button started out at the end of the finding's line, which is where it's
    invisible - findings are long and that's well past the window edge. It's on
    its own indented line now.
  • The footer hint for folding rendered as M-x outline-toggle-children because
    nothing was bound to it. The doctor now binds f for that, and TAB/n for
    moving between the action buttons it has acquired.

Setting an option goes through customize-set-variable and says it's for this
session unless saved, rather than quietly setting a variable the user would then
find mysteriously changed.

The doctor told you what was wrong and then described, in prose, what to
type about it. Flycheck's verify buffer does better: a disabled checker
renders with an [enable] button right there.

Findings are plists now rather than (SEVERITY . MESSAGE) conses, so one
can carry an action and a label for it. The four that Projectile can
actually do something about get a button - enabling the mode, enabling
caching, opening the dirconfig, editing .dir-locals.el - and pressing it
regenerates the report, so the finding that prompted the action answers
for itself. A missing fd still gets prose, because there's nothing to
press.

The button goes on its own line under the finding: findings run long,
and at the end of one the button lands past the window edge where nobody
would find it. The doctor also gained button navigation and a fold key,
now that it has buttons worth moving between.
@bbatsov
bbatsov merged commit ab3599c into master Jul 28, 2026
10 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.

1 participant