feat: Go to scopes are grouped like the Sources pane, an account at a time
The scope list follows the Sources pane: All, then each account (or Databricks, or Repos) with its sources under it, in place of All Azure, All Databricks and All repos. An account scope searches and loads only that account. ctrl+s on a group header narrows to its group. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
57aec8a381
commit
331e53fb49
7 files changed
+124
-74
No files matched your search
@@ -218,6 +218,31 @@ func TestSearchStartsWhereYouAre(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestSearchNarrowsToAccount(t *testing.T) {
|
||||
t.Parallel()
|
||||
d := newDriver(t)
|
||||
d.keys("1", "g") // the first group header
|
||||
header, _ := d.m.sources.Selected()
|
||||
d.openSearch()
|
||||
d.send(ctrl('s'))
|
||||
v := d.m.search
|
||||
if v.scope().id != accountScope+header.provider {
|
||||
t.Fatalf("ctrl+s on %q narrowed to %q", header.label, v.scope().id)
|
||||
}
|
||||
if len(v.shown) == 0 || !strings.Contains(d.screen(), "Results in "+header.label) {
|
||||
t.Errorf("no results in the account:\n%s", d.screen())
|
||||
}
|
||||
for _, o := range v.shown {
|
||||
if providerOf(o.group) != header.provider {
|
||||
t.Errorf("result from another account: %q", ansiStrip(o.label))
|
||||
}
|
||||
}
|
||||
// The account's sources are under it, indented.
|
||||
if next := v.scopes[v.src+1]; next.group == "" || providerOf(next.group) != header.provider || !strings.HasPrefix(ansiStrip(next.label), " ") {
|
||||
t.Errorf("after the account: %q", ansiStrip(next.label))
|
||||
}
|
||||
}
|
||||
|
||||
func TestSearchHint(t *testing.T) {
|
||||
t.Parallel()
|
||||
d := newDriver(t)
|
||||
|
||||
Reference in new issue
Block a user