Skip to content

feat(plugin-profiles): one-pane /plugin-profile picker, readable preview and a No profile choice - #16759

Merged
kyle-sexton merged 7 commits into
mainfrom
fix/16747-plugin-profile-readability
Nov 17, 2026
Merged

kyle-sexton merged 7 commits into
mainfrom
fix/16747-plugin-profile-readability

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #16747

Summary

/plugin-profile was hard to read in a live session (Claude Code 2.1.326, plugin-profiles 0.3.0). This PR fixes the seven defects the owner saw:

  1. Picker paged three at a time. It is now one focused pane holding a Select of every profile plus No profile, with a Cancel button. The owner chose this shape (option A) on 2026-11-17.
  2. Preview showed as one cut-off paragraph. The list and the preview now log one line per row. The long "Left alone" list is shown as a count.
  3. Confirm named the running session under "Other sessions". It no longer does.
  4. Closing line doubled the plugin-profiles: prefix. The prefix is gone.
  5. After Apply, nothing said a message is needed. It now says plainly to send any message or run /reload-plugins.
  6. "Stay loaded" printed when nothing was turned off. That sentence now appears only when the switch turned plugins off.
  7. No way back to the state before any profile. No profile clears the folder's profile behind the same preview, confirm and reload as a switch.

Fix

  • 1, picker: hooks/register.tsx opens a pane with focus and closeOnEscape, then shows today's preview and Apply/Cancel unchanged.
    • Mobile gets one Button per entry instead of the Select. Basis: the mods reference bundled with 2.1.326 says "a mobile app that does not say it draws Input or Select shows nothing for it".
    • Where no pane can be placed, the picker falls back to the existing paged $.ui.ask.
    • The entries live in $.state (picker), so the pane's drawing reads them.
  • 2, preview: $.ui.log "Appends one line to the transcript" and the terminal draws its first 2000 characters (2.1.326 mods types). So each line is its own call.
    • profiles.mjs apply --dry-run --json now counts the left-alone plugins in its lines and returns them as an untouched array.
    • The terminal preview still names them all.
  • 3, other sessions: the CLI already leaves out the session whose CLAUDE_CODE_SESSION_ID it is given, but the mod's $.process.run never passed one. The mod now passes $.session.id().
  • 4, prefix: removed from the mod's own $.ui.log text, since the engine adds the plugin name itself.
  • 5, reload: wording only. The mods types list no event that fires after a local slash command, and a reload run from the command's own handler does not take. So the reload still waits for the next turn's end, and the output says how to trigger it.
  • 6, stay loaded: the switch stores which plugins it turns off. The in-force line names them only when there are some.
  • 7, No profile: runs profiles.mjs clear --for folder --dry-run, then clear --for folder --yes, then reloads at the turn end. The CLI stays the one place that decides what a clear does.
    • A folder with nothing to clear says what loads instead, and that /reload-plugins drops an earlier profile's plugins still loaded.

Verification

  • claude plugin test plugins/plugin-profiles: 26 pass, 0 fail.
    • Each Make the /plugin-profile picker and preview readable in a live session #16747 case failed on the previous register.tsx and passes now.
    • The cases cover: one line per log call; the session id passed to the CLI; no prefix and no "stay loaded" line when nothing is turned off; the pane listing every profile plus No profile; a mobile Button pick; Cancel in the pane; the clear flow; Cancel at the clear confirm; a folder with nothing to clear.
  • node --test plugins/plugin-profiles/scripts/profiles.test.mjs: 84 pass, 0 fail, including a new case for the counted left-alone line.
  • claude plugin validate plugins/plugin-profiles passes. Four TS2532 warnings remain on w.asks[0] lines of the test file.
  • Reload behaviour probe, so the clear wording rests on evidence. Setup: Claude Code 2.1.326, claude -p with stream-json input, a throwaway folder, local commands only.
    • Toggling adhd@melodic-software in .claude/settings.local.json between three /reload-plugins runs gave 87 plugins / 334 skills, then 86 / 332 with it off, then 87 / 334 with it back on.
    • So /reload-plugins unloads a plugin switched off mid-session and loads one switched on. This matches the plugin commands reference: "Pending changes are plugins you installed, updated, enabled, disabled, or edited on disk".
    • It also corrects an earlier claim: a switch's off plugins stay loaded until a later /reload-plugins or the next session start, not only the next start.
  • Not verified: an interactive session clicking through the pane. The tests drive it through claude plugin test's mount.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_015XWwmeiHDDb7KAyHDYWQ2G

kyle-sexton and others added 4 commits November 17, 2026 09:45
…ile choice

The preview and profile list log one line per call, since $.ui.log draws
one line, and count the plugins left alone; the CLI is passed this session's
id so the confirm does not list it among other sessions; the closing line
drops its doubled prefix and names left-loaded plugins only when there are
some; after Apply it says to send a message or run /reload-plugins, since no
event fires after a local command. The picker gains No profile, which clears
the folder's profile behind the same preview, confirm and reload.

Refs: #16747

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XWwmeiHDDb7KAyHDYWQ2G
…file

/plugin-profile opens a focused pane holding a Select of every profile and
No profile, with a Cancel button. Mobile gets a Button per entry, since a
mobile app may draw nothing for a Select; where no pane can be placed the
paged question dialog stays as the fallback. The entries live in $.state so
the pane's drawing reads them.

Refs: #16747

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XWwmeiHDDb7KAyHDYWQ2G
@kyle-sexton

Copy link
Copy Markdown
Member Author

Owner of this pull request: the hub session "Plugin Presets", which runs the plugin-profiles work for #16747. It waits on the ready gates and CI, and then on the owner trying /plugin-profile in a live session before the profiles rollout. The pane picker has only been exercised through claude plugin test, not clicked through interactively.

@kyle-sexton
kyle-sexton marked this pull request as ready for review November 17, 2026 14:54
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T14:57:39.545292Z 77e09b5 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 77e09b5667

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-refine/fix-docs
Model rung 0
Leg handoff
Run job success
Activity step success
Commits pushed none (read lane)
Run 44108365326

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-review: 1 inline finding(s) on 77e09b56670325597a9817b7c882f7746d1966c4; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 83386c0abe68f8eeec55df19bc1f6acca3c74625: read 6 of 6 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #16759, incremental (77e09b5 → 83386c0)

I found no security issues. I read every hunk of all 6 files listed in .claude-lane/incremental.diff. An earlier head was already reviewed, so this review was blocking only: it reports CRITICAL and IMPORTANT findings and drops suggestions.

Scope. None of the changed files match a trusted path. None is a plugin manifest, trust control, merge hold, workflow or instruction-surface guardrail.

What I checked:

  • clear --dry-run --json (scripts/profiles.mjs):
    • The new flag is accepted only for clear.
    • --json without --dry-run is still rejected, the same rule apply follows.
    • The JSON output carries recorded, sessionProfile and the preview lines. They come from the local record and from the PLUGIN_PROFILES_SESSION env var. No token or secret is exposed and nothing leaves the machine.
    • The write path (--yes plus consent) is unchanged.
  • Mod flow (hooks/register.tsx):
    • clearProfile now uses JSON.parse on its own CLI's stdout, and only after a zero exit code. It replaces the old string-prefix check.
    • The parsed lines and sessionProfile are shown only as log text. Nothing passes them to a command.
    • The clear still needs an explicit Apply at the confirm.
    • The new keeps field on the pending atom changes only the message finish logs.
  • Preview hint: it now prints the CLI's own path as a suggested terminal command, which is display only. Removing untouched from the apply JSON only drops data.
  • Tests, types and the changeset: they have no security surface.

Spend: none beyond the existing run.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 83386c0abe68f8eeec55df19bc1f6acca3c74625: read 6 of 6 changed file(s); 0 finding(s), 0 as inline comments.

Code review (incremental, blocking only): PR #16759, 77e09b5..83386c0

I read every hunk of the 6 files in the incremental scope: the changelog fragment, register.tsx, plugin-profile.test.ts, profiles.mjs, profiles.test.mjs and types/index.d.ts. I also read the head register.tsx around cli, failure, clearProfile and finish, and the imports in profiles.mjs. This lane already reviewed an earlier head, so this pass reports blocking findings only.

What changed since the last review

  • clear takes --json. It now accepts --json alongside --dry-run and refuses --json without --dry-run, the same rule apply follows. It prints { recorded, sessionProfile, lines }.
  • One-session profiles. When PLUGIN_PROFILES_SESSION is set, clear adds a line saying the session keeps its one-session profile. This happens with or without --json, and on the real clear as well as the dry run.
  • The mod reads the JSON. It now parses the JSON preview instead of matching the start of the text output. It stores keeps on the pending Switch record, and the turn-end message names the profile the session keeps.
  • Left-alone hint. The hint for the plugins left alone now prints a runnable node "<profiles.mjs>" apply … --dry-run. fileURLToPath is already imported at profiles.mjs:84. The unread untouched array is gone from the preview.

Settled threads: both are resolved at this head with no lines changed since. These are the one-session clear report on register.tsx:105-107 and this lane's earlier left-alone hint advisory on profiles.mjs. The fixes match what the owner's replies describe, and I am not raising either point again.

Closing issue #16747: this push adds nothing that undoes a Done-when item. The new behaviour has CLI tests for JSON shape, the --json refusal and the session-keeps line, plus mod tests for the JSON clear path, the session-keeps closing line and closing the pane on Cancel. I did not run any tests. The passing results are the author's claim and unverified.

Loosened checks: no assertion was weakened.

  • preview.untouched changed from deepEqual([...]) to equal(undefined), because the field was removed on purpose per the owner's reply.
  • The nothing-to-clear wording changed, and the test now also checks that the CLI's own line is logged.

The wrapper wrote no verdict or patterns line, so I used the defaults. Loosened-check verdict: fail (default, no wrapper line); patterns: 0.

Other checks:

  • No plugin manifest changed. The fragment's bump: minor still fits the new clear --json option.
  • No hold applies, and the change spends nothing.
  • No embedded instructions appeared in the PR context, settled-threads or prior-findings files.

No candidates came up, so I dispatched no verifier.

Verifier dropped 0 of 0 candidates.

kyle-sexton and others added 3 commits November 17, 2026 10:26
…ding, runnable left-alone hint

clear --dry-run --json reports whether a profile is recorded, the
one-session profile the running session keeps, and the lines, so the mod no
longer matches the tool's wording, and a clear in a session started with a
one-session profile says the session keeps it instead of claiming it loaded
the user and project settings. The mod preview's left-alone hint is now a
runnable command, and the unread untouched array is gone.

Refs: #16747

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XWwmeiHDDb7KAyHDYWQ2G
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make the /plugin-profile picker and preview readable in a live session

1 participant