Commit b8e7e64
Haider
fix(tui): address OpenCodeReview findings on skills-install classifier
Two medium findings from the automated review pass on this PR:
1. `installSkillDirect` used the raw `normalized` input when building a
clone URL, but `classifyInstallSource` tolerates a trailing `.git`
suffix / whitespace / trailing dots. An input like `owner/repo.git`
passed the classifier's `owner-repo` check and then produced
`https://github.com/owner/repo.git.git`. Extracted the trim/strip
logic into `normalizeInstallSource` and use it in both the classifier
and the URL builder so the two can't disagree on shape.
2. The `options` `createMemo` read the `filter()` signal, so every
keystroke re-executed the full `list.map` — including
`detectToolReferences` (regex parse per skill). Split into a
`baseOptions` memo that depends only on `skills()` and a derived
`options` memo that composes the synthetic Install row on top. Now a
filter change only re-checks `classifyInstallSource(q)` and prepends
one item; `detectToolReferences` only re-runs when the underlying
skills list changes.
Also adds a `normalizeInstallSource` unit-test suite (4 cases pinning
the `.git` / trailing-dot / whitespace behaviour) alongside the existing
classifier tests.
Verified: `bun run typecheck` clean; classifier suite 14/14 (54 expects);
fork-feature-guards 18/18 (61 expects).1 parent 716735c commit b8e7e64
2 files changed
Lines changed: 54 additions & 5 deletions
File tree
- packages/opencode
- src/plugin/tui/altimate
- test/altimate
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
46 | 55 | | |
47 | | - | |
| 56 | + | |
48 | 57 | | |
49 | 58 | | |
50 | 59 | | |
| |||
176 | 185 | | |
177 | 186 | | |
178 | 187 | | |
179 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
180 | 194 | | |
181 | 195 | | |
182 | 196 | | |
| |||
589 | 603 | | |
590 | 604 | | |
591 | 605 | | |
592 | | - | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
593 | 611 | | |
594 | 612 | | |
595 | | - | |
| 613 | + | |
596 | 614 | | |
597 | 615 | | |
598 | 616 | | |
| |||
605 | 623 | | |
606 | 624 | | |
607 | 625 | | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
608 | 630 | | |
609 | 631 | | |
610 | 632 | | |
| |||
Lines changed: 28 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
0 commit comments