Skip to content

Commit a531217

Browse files
committed
Address Copilot review comments and update VitePress docs
- Remove parentheses from sticky repo header match count (visual consistency with repo rows) - Fix termWidth padding off-by-one: termWidth - leftLen - countLen (was subtracting an extra 1, leaving line one column short) - Add renderGroups unit test asserting right-aligned row fits termWidth - Fix README: 'organisation' → 'organization' (consistent American spelling) - Fix SECURITY.md: 'Reporting security vulnerability Issues' → 'Reporting security vulnerabilities' - Fix SECURITY.md: 'In any ways' → 'In any case' - Update docs/usage/interactive-mode.md: reflect new TUI glyphs (▸/▾ arrows, ✓/space checkboxes, right-aligned counts, brand badge)
1 parent b876222 commit a531217

6 files changed

Lines changed: 40 additions & 23 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ github-code-search query "TODO" --org my-org
2222

2323
## Features
2424

25-
- **Org-wide search** — queries all repositories in a GitHub organisation in one command, with automatic pagination up to 1 000 results
25+
- **Org-wide search** — queries all repositories in a GitHub organization in one command, with automatic pagination up to 1 000 results
2626
- **Per-repository aggregation** — results grouped by repo, not as a flat list; fold/unfold each repo to focus on what matters
2727
- **Keyboard-driven TUI** — navigate with arrow keys, toggle selections, filter by file path, confirm with Enter — without leaving the terminal
2828
- **Fine-grained selection** — pick exactly the repos and extracts you want; deselected items are recorded as exclusions in the replay command

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ We take the security of our software products and components seriously, which in
44

55
If you believe you have found a security vulnerability in any Fulll's repository that meets Wikipedia's definition of a security vulnerability ([English version](<https://en.wikipedia.org/wiki/Vulnerability_(computing)>), [French version](<https://fr.wikipedia.org/wiki/Vuln%C3%A9rabilit%C3%A9_(informatique)>)), please report it to us as described below.
66

7-
## Reporting security vulnerability Issues
7+
## Reporting security vulnerabilities
88

99
:warning: **Please do not report security vulnerabilities through public GitHub issues.**
1010

@@ -14,7 +14,7 @@ You should receive a response as soon as possible. If for some reason you do not
1414

1515
For private repositories, you can also send an email or directly use the dedicated issue template for security vulnerability.
1616

17-
:bulb: In any ways, please include the requested information listed below (**as much as you can provide**) to help us better understand the nature and scope of the possible issue:
17+
:bulb: In any case, please include the requested information listed below (**as much as you can provide**) to help us better understand the nature and scope of the possible issue:
1818

1919
- Type of issue (e.g. Denial of service, Elevation of privilege, Information disclosure, Remote Code Execution, Security feature bypass, buffer overflow, SQL injection, cross-site scripting, etc.)
2020
- Full paths of source file(s) related to the manifestation of the issue

docs/index.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,14 @@ The official [`gh` CLI](https://cli.github.com/) supports `gh search code`, but
9999

100100
| | `gh search code` | `github-code-search` |
101101
| ------------------------------------------ | :--------------: | :------------------: |
102-
| Results grouped by repo | | |
103-
| Interactive TUI (navigate, select, filter) | | |
104-
| Fine-grained extract selection | | |
105-
| Markdown / JSON output | | |
106-
| Replay / CI command | | |
107-
| Team-prefix grouping | | |
108-
| Syntax highlighting in terminal | | |
109-
| Pagination (up to 1 000 results) | | |
102+
| Results grouped by repo | | |
103+
| Interactive TUI (navigate, select, filter) | | |
104+
| Fine-grained extract selection | | |
105+
| Markdown / JSON output | | |
106+
| Replay / CI command | | |
107+
| Team-prefix grouping | | |
108+
| Syntax highlighting in terminal | | |
109+
| Pagination (up to 1 000 results) | | |
110110

111111
`github-code-search` is purpose-built for **org-wide code audits and interactive triage** — not just a search wrapper.
112112

docs/usage/interactive-mode.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,25 @@ github-code-search "useFeatureFlag" --org fulll
1111
## TUI overview
1212

1313
```text
14-
GitHub Code Search: useFeatureFlag in fulll
14+
github-code-search useFeatureFlag in fulll
1515
3 repos · 4 files
1616
← / → fold/unfold ↑ / ↓ navigate spc select a all n none f filter h help ↵ confirm q quit
1717
18-
▶ ◉ fulll/billing-api (3 extracts)
19-
▼ ◉ fulll/auth-service (2 extracts)
20-
src/middlewares/featureFlags.ts
18+
fulll/billing-api 3 matches
19+
▾ ✓ fulll/auth-service 2 matches
20+
src/middlewares/featureFlags.ts
2121
…const flag = useFeatureFlag('new-onboarding'); if (!flag) return next();…
22-
tests/unit/featureFlags.test.ts
22+
tests/unit/featureFlags.test.ts
2323
…expect(useFeatureFlag('new-onboarding')).toBe(true);…
24-
▶ ○ fulll/legacy-monolith (1 extract)
24+
fulll/legacy-monolith 1 match
2525
```
2626

27-
- `` — folded repo (extracts hidden)
28-
- `` — unfolded repo (extracts visible)
29-
- `` — selected
30-
- `` — deselected
27+
- `` — folded repo (extracts hidden)
28+
- `` — unfolded repo (extracts visible)
29+
- `` — selected (green in the terminal)
30+
- ` ` — deselected (space — keeps columns aligned)
31+
- Match counts are right-aligned to the terminal width
32+
- The header badge `github-code-search` is displayed on a violet background
3133

3234
## Keyboard shortcuts
3335

src/render.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,21 @@ describe("renderGroups", () => {
593593
expect(stripped).toContain("org/repoA");
594594
expect(out).toBeTruthy(); // must not crash
595595
});
596+
597+
it("right-aligns match count to termWidth", () => {
598+
// With termWidth=60 the visible width of the repo row should equal 60
599+
// (padding fills the gap between repo name and count).
600+
const groups = [makeGroup("org/repoA", ["a.ts", "b.ts"], false)];
601+
const rows = buildRows(groups);
602+
const termWidth = 60;
603+
const out = renderGroups(groups, 0, rows, 40, 0, "q", "org", { termWidth });
604+
// Extract just the repo row line (first line after the hint bar)
605+
const lines = out.split("\n");
606+
const repoLine = lines.find((l) => l.replace(/\x1b\[[0-9;]*m/g, "").includes("org/repoA"));
607+
expect(repoLine).toBeDefined();
608+
const visibleLen = repoLine!.replace(/\x1b\[[0-9;]*m/g, "").length;
609+
expect(visibleLen).toBe(termWidth);
610+
});
596611
});
597612

598613
// ─── buildRows with filterPath ────────────────────────────────────────────────

src/render.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export function renderGroups(
140140
const g = groups[cursorRow.repoIndex];
141141
const checkbox = g.repoSelected ? pc.green("✓") : " ";
142142
stickyRepoLine = pc.dim(
143-
`▲ ${checkbox} ${pc.bold(g.repoFullName)} ${pc.dim(`(${buildMatchCountLabel(g)})`)}`,
143+
`▲ ${checkbox} ${pc.bold(g.repoFullName)} ${pc.dim(buildMatchCountLabel(g))}`,
144144
);
145145
lines.push(stickyRepoLine);
146146
}
@@ -182,7 +182,7 @@ export function renderGroups(
182182
const leftPart = `${arrow} ${checkbox} ${repoName}`;
183183
const leftLen = stripAnsi(leftPart).length;
184184
const countLen = stripAnsi(count).length;
185-
const pad = Math.max(1, termWidth - leftLen - countLen - 1);
185+
const pad = Math.max(1, termWidth - leftLen - countLen);
186186
lines.push(`${leftPart}${" ".repeat(pad)}${count}`);
187187
} else {
188188
const ei = row.extractIndex!;

0 commit comments

Comments
 (0)