ccperm 1.11.2 → 1.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/interactive.js +8 -4
- package/package.json +1 -1
package/dist/interactive.js
CHANGED
|
@@ -139,13 +139,17 @@ function startInteractive(merged, results) {
|
|
|
139
139
|
function renderList(state, withPerms, emptyCount) {
|
|
140
140
|
const rows = process.stdout.rows || 24;
|
|
141
141
|
const cols = process.stdout.columns || 80;
|
|
142
|
-
const w = Math.min(cols, 82);
|
|
143
|
-
const inner = w - 4; // box border + 1 space each side
|
|
144
142
|
const cats = ['Bash', 'WebFetch', 'MCP', 'Tools'];
|
|
145
143
|
const catsPresent = cats.filter((c) => withPerms.some((r) => r.groups.has(c)));
|
|
146
144
|
const catColWidth = catsPresent.length * 7;
|
|
145
|
+
const typeColWidth = 7; // " local " or " shared"
|
|
147
146
|
const maxName = Math.max(...withPerms.map((r) => r.shortName.length), 7);
|
|
148
|
-
const
|
|
147
|
+
const nameColWidth = Math.min(maxName + typeColWidth, 35); // name + type combined
|
|
148
|
+
const nameWidth = nameColWidth - typeColWidth;
|
|
149
|
+
// content: marker(2) + nameCol(nameColWidth) + gap(2) + catCols + gap(2) + total(5)
|
|
150
|
+
const contentWidth = 2 + nameColWidth + 2 + catColWidth + 2 + 5;
|
|
151
|
+
const w = Math.min(cols, contentWidth + 4); // +4 for box borders + padding
|
|
152
|
+
const inner = w - 4;
|
|
149
153
|
const hasGlobalSep = withPerms.some((r) => r.isGlobal) && withPerms.some((r) => !r.isGlobal);
|
|
150
154
|
// box takes: top(1) + header(2) + sep(1) + content + globalSep?(1) + emptyLine?(1) + bottom(1)
|
|
151
155
|
const chrome = 5 + (hasGlobalSep ? 1 : 0) + (emptyCount > 0 ? 1 : 0);
|
|
@@ -157,7 +161,7 @@ function renderList(state, withPerms, emptyCount) {
|
|
|
157
161
|
const scrollInfo = withPerms.length > visibleRows ? `${state.cursor + 1}/${withPerms.length}` : '';
|
|
158
162
|
const lines = [];
|
|
159
163
|
lines.push(boxTop('ccperm', scrollInfo, w));
|
|
160
|
-
lines.push(boxLine(`${colors_js_1.DIM}${pad('PROJECT',
|
|
164
|
+
lines.push(boxLine(`${colors_js_1.DIM}${pad('PROJECT', nameColWidth)} ${catsPresent.map((c) => rpad(c, 5)).join(' ')} TOTAL${colors_js_1.NC}`, w));
|
|
161
165
|
lines.push(boxSep(w));
|
|
162
166
|
const globalCount = withPerms.filter((r) => r.isGlobal).length;
|
|
163
167
|
const end = Math.min(state.scrollOffset + visibleRows, withPerms.length);
|