Repository navigation
Security: collapsed rule groups with 7-day counts, redaction exceptions; pin core v0.86.0 - #389
Merged
Merged
Conversation
The rule tables (secrets & privacy, dangerous commands, content filter) now start with every group collapsed. A group head reads "name · N rules · N on · N matches in the last 7 days" and toggles on click, Enter or Space (Right expands, Left collapses); Up/Down move between heads and the rows of expanded groups. Which groups are open is remembered per protection in localStorage. Searching expands every matching group; a group collapsed during a search stays collapsed only for that search term. Built-in groups with matches in the last 7 days move to the front, each part keeping core's order; the custom group stays last. Core has no per-rule counts, so the counts come from one page (up to 500) of the protection's security log over the same 7-day window the log uses; when the window holds more than one page the count is a lower bound and is written as "N+". The page is read when the tab opens, not on every new request, so groups do not jump while being read. Groups without matches show no count. The "Built-in" label in group heads is dropped (the head format follows the spec). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Core v0.86.0 (control API 57). - Group heads take their 7-day counts from GET /security/counts: exact per-rule totals (the sum of each entry's count), so the one-page log read and the "N+" lower bound are gone. - Redaction exceptions. Below the secrets & privacy rule table, a section "Exceptions · N values" lists each excepted value (masked), the rule that first found it (none for values added by hand), when it was added, and "Remove". "Add exception" opens a dialog with a hidden input and the eye toggle; it is disabled at the limit, with the limit written next to it. Without exceptions the section is one line and the button. Removing asks for confirmation (it cannot be undone without the value). - Security log: an expanded redaction hit offers "List as exception" when core marks it exceptable; the confirmation shows the masked value and the rule. Values that are exceptions now carry an "Exception" tag in the log row and the hit detail. Core's refusal (entry too old, saved secret, limit reached) is shown in the dialog. - Test: excepted values are not highlighted and read "Exception, not handled". - New endpoints are on the webview allow-list (both sides); Chinese sentences for the new message codes; regenerated bindings and screenshot fixtures; screenshot mocks answer the new endpoints. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What
Pins core v0.86.0 (control API 57) and builds two UI pieces on it.
Rule groups (all three rule tables)
name · N rules · N on · N matches in the last 7 days(zh:N 条 · 已开 N 条 · 最近 7 天命中 N 次). Groups without matches show no count.GET /security/counts(exact per-rule totals since the start of the 7-day window the log uses). They are read when the tab opens, not on every new request, so groups do not reorder while being read.Redaction exceptions
Exceptions · N valuesbelow the rule table shows the masked value, the rule that first found it (none for values added by hand), when it was added, andRemove. Removing asks for confirmation.Add exceptionopens a dialog with a hidden input and an eye toggle. At the limit the button is disabled and the limit is shown next to it. With no exceptions, the section shows one line and the button.List as exceptionwhen core marks itexceptable. The confirmation states that the value will no longer be replaced or recorded, and shows the masked value and the rule. If core refuses (entry too old, saved secret, limit reached), its message is shown in the dialog. Values that are exceptions now are taggedExceptionin the log row and in the hit detail.Exception, not handled.Pin
v0.86.0, regenerated TS bindings, Chinese sentences for the new message codes, and the new endpoints on both webview allow-lists.Notes
· 内置/· Built-inlabel in group heads is dropped; the head follows the spec format.Tests
src/security/groups.test.tsx: counts, ordering, collapse state, search auto-expand, keyboard.src/security/exceptions.test.tsx: section states (empty, list, at limit, English), the hit-detail button and tag, and the calls sent to core.🤖 Generated with Claude Code