Skip to content

Commit d1a3bde

Browse files
ithiria894claude
andcommitted
feat: collapsible rule bar explaining per-category inheritance rules (v0.13.2)
When Show Effective is active, a "How does each category inherit?" toggle appears below the pills bar. Click to expand a list showing every category's official scope rule (or "No official scope rule" for categories without one). Follows the same toggle pattern as Context Budget's "What does this mean?". Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent fb35636 commit d1a3bde

5 files changed

Lines changed: 51 additions & 3 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mcpware/claude-code-organizer",
3-
"version": "0.13.1",
3+
"version": "0.13.2",
44
"description": "Organize all your Claude Code memories, skills, MCP servers, commands, agents, rules, and hooks — see what loads globally vs per-project, then move items between scopes",
55
"type": "module",
66
"files": [

src/ui/app.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ function renderAll() {
539539
renderSidebar();
540540
renderContentHeader();
541541
renderPills();
542+
renderRuleBar();
542543
renderMainContent();
543544
updateBulkBar();
544545

@@ -757,6 +758,41 @@ function renderPills() {
757758
}
758759
}
759760

761+
function renderRuleBar() {
762+
const bar = document.getElementById("ruleBar");
763+
const toggle = document.getElementById("ruleBarToggle");
764+
const content = document.getElementById("ruleBarContent");
765+
if (!bar || !toggle || !content) return;
766+
767+
if (!showEffective || !selectedScopeId || selectedScopeId === "global") {
768+
bar.classList.add("hidden");
769+
return;
770+
}
771+
772+
bar.classList.remove("hidden");
773+
774+
// Build rule rows for all categories
775+
const rows = CATEGORY_ORDER.map(cat => {
776+
const config = CATEGORIES[cat];
777+
if (!config) return "";
778+
const rule = config.effectiveRule;
779+
const noRule = !rule;
780+
return `<div class="rule-row${noRule ? " rule-none" : ""}">
781+
<span class="rule-cat">${config.icon} ${esc(config.filterLabel)}</span>
782+
<span class="rule-text">${esc(rule || "No official scope rule")}</span>
783+
</div>`;
784+
}).join("");
785+
786+
content.innerHTML = rows;
787+
788+
// Toggle handler (re-attach each render since innerHTML may have changed)
789+
toggle.onclick = () => {
790+
content.classList.toggle("hidden");
791+
toggle.querySelector(".ctx-toggle-arrow").textContent =
792+
content.classList.contains("hidden") ? "▸" : "▾";
793+
};
794+
}
795+
760796
function renderMainContent() {
761797
const itemList = document.getElementById("itemList");
762798
const scope = getScopeById(selectedScopeId);

src/ui/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@
4646
<button class="export-btn ctx-budget-btn" id="ctxBudgetBtn" type="button" title="Show context token budget for this scope">Context Budget</button>
4747
</div>
4848
<div class="filter-bar" id="pills"></div>
49+
<div class="rule-bar hidden" id="ruleBar">
50+
<div class="rule-bar-toggle" id="ruleBarToggle"><span class="ctx-toggle-arrow"></span> How does each category inherit?</div>
51+
<div class="rule-bar-content hidden" id="ruleBarContent"></div>
52+
</div>
4953
</div>
5054

5155
<div class="item-list" id="itemList"></div>

src/ui/style.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,14 @@ body {
958958
.s-tree-toggle { cursor: pointer; font-size: 0.7rem; opacity: 0.5; margin-left: auto; padding: 0 4px; }
959959
.s-tree-toggle:hover { opacity: 1; }
960960
.s-tree-toggle.active { opacity: 1; }
961+
.rule-bar { padding: 0 16px 6px; }
962+
.rule-bar-toggle { font-size: 0.68rem; color: var(--text-muted); cursor: pointer; user-select: none; }
963+
.rule-bar-toggle:hover { color: var(--accent); }
964+
.rule-bar-content { margin-top: 6px; font-size: 0.68rem; color: var(--text-muted); line-height: 1.7; }
965+
.rule-bar-content .rule-row { display: flex; gap: 8px; padding: 2px 0; }
966+
.rule-bar-content .rule-cat { font-weight: 700; color: var(--text-primary); min-width: 70px; flex-shrink: 0; }
967+
.rule-bar-content .rule-text { color: var(--text-muted); }
968+
.rule-bar-content .rule-none { opacity: 0.5; }
961969
.d-effective-wrap { padding: 0 0 8px; }
962970
.d-effective { font-size: 0.72rem; color: var(--text-muted); line-height: 1.5; padding: 4px 0; }
963971
.theme-btn.active { background: var(--accent-light); color: var(--accent-text); border-color: var(--accent); }

0 commit comments

Comments
 (0)