Repository navigation
fix(toggle): report a toggle that another ignore rule overrides - #989
Merged
Merged
Conversation
The list TUI and `skillshare enable/disable` trusted the line they wrote or removed. When a glob, a folder rule, a tracked repo's own .skillignore or a "!" rule in the .local file still decided the state, the TUI flipped the row and the CLI printed success, while sync kept doing the opposite. The dashboard already checked the result, but with its own copy of the logic. internal/toggle now owns the flow for all three: resolve the name through the same discovery list and the dashboard use, write or remove the lines, discover again, and report each item that did not reach the requested state, naming the file whose rule decides it. The CLI exits 1 and logs error or partial, the TUI keeps the row and shows the reason, and Herdr shows the CLI's reason. Names now reach the item the user means. An exact path or flat name picks that item alone. A name that the written line could not match, such as an agent's frontmatter name or a flat name, writes the item's path, as the dashboard does. Enable also removes each named item's path line, so `enable inner` undoes the `group/inner` line the TUI or dashboard wrote. An agent typed without .md gets .md, which `.agentignore` rules need to match the file. Docs that showed agent lines without .md are fixed.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
6 of 9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type
proposals/only — see CONTRIBUTING.md)approvedlabel)Linked Issue
No issue. Listed under "Not in this PR" in #985 and #987.
What was wrong
The list TUI toggle (
t) andskillshare enable/disableassumed the line they wrote or removed decided the item's state. Often another rule decides it:draft-*;frontend/orarchive/;.skillignore;!rule in.skillignore.localor.agentignore.local.Then the TUI flipped the row and the CLI printed success or "not disabled" and exited 0, while
synckept doing the opposite. The dashboard already checked the result after writing, but with its own copy of the logic, and its 409 message named.skillignoreeven for agents.Names also missed the item the user meant:
enable innerdid not remove agroup/innerline, which the TUI and dashboard write.disable reviewer --kind agentwrotereviewer, which never matchesreviewer.md. The docs taught this form and showed.agentignoreexamples without.md.Fix
internal/togglenow does the work for the CLI, the TUI and the dashboard:listand the dashboard use, including agents in ignored folders since fix(agents): list agents in .agentignore'd folders as disabled #987..skillignore.Entry points choose only which lines to write:
partialorerrorinstead of alwaysok. The single toggle's 409 is now logged..mdgets.mdappended.enablealso removes each named item's path line.--dry-runlists every line.error, orpartialwhen other items changed.Herdr: when the CLI exits non-zero, the panel shows its last line, which carries the reason. With an older CLI that exits 0, the panel still re-checks
list --jsonas before.Behavior changes
skillshare enable/disableexits 1 when another rule keeps an item from changing. Scripts that ignored the result will now see the failure.enable <name>matching several skills enables all of them and reports each one.disable <name>with an unanchored line disables all of them, as before.disable <frontmatter name> --kind agentanddisable <flat name>now write the item's path, so they take effect.foocould togglea/fooinstead.Tests
Each fails on
main, except where noted, and passes with the fix:internal/toggle:Applynames the deciding file, catches a!rule that undoes a disable, and reports the lines it changed;Linescovers globs, exact paths, flat names, frontmatter names, a nested agent's file name,.mdappending and several matches.tests/integration/enable_test.go(wiring):.agentignore;!in.skillignore.localand in.agentignore.local, with the oplogerror;enable innerremovesgroup/inner;--dry-runlists the path line;mainpasses this one because it did not check.!rule. In each case the row keeps its state and shows the reason..agentignoreand is logged;partial.Checks
make checkpasses in the devcontainer, including the Herdr tests.list --json;enable react-uiwith an ignoredarchive/react-uiexits 0;enable innerwithgroup/innerand a blockingother/rule prints a ✓ row, a ✗ line and the sync hint, exits 1 and logspartial.enable reviewer.md --kind agentforteam/reviewer.mdunder ateam/rule exits 1 and names.agentignore.scripts/screenshots/record-tui.shand a!rule added to a local copy of its fixture. The scenario is not added to the script.make checkincludes the docs checks.Not in this PR
main.skillshare disable inner(lineinner) cannot be enabled from them. They now say so and name the file, andskillshare enable innerremoves the line.disableundone by a!rule leaves its line in the ignore file, where it has no effect.Checklist
make check) — for code changes