Skip to content

Commit 492b23e

Browse files
committed
fix(desktop): restore workspace logo to rail top
Revert the iteration-8 move that placed the workspace switcher above Settings; match Nexus sidebar-top pattern with Settings alone in rail-bottom.
1 parent 2954e4e commit 492b23e

4 files changed

Lines changed: 23 additions & 25 deletions

File tree

libs/naas-abi/naas_abi/apps/desktop/AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ desktop/
125125

126126
A workspace is a **folder on disk** (VS Code / Cursor semantics), not a Nexus tenant.
127127

128-
- **UI**: icon rail bottom (above Settings): **logo button only** opens a glass portal dropdown to the right (square corners). Hover on the logo shows the full path; the menu lists recent workspaces with a checkmark on the active entry and **Open Folder…**. The status bar left shows the current workspace basename and git branch as read-only context (no switch action). Top bar and main body stay clean (panel toggle + section title only). Rail top is an empty spacer.
128+
- **UI**: icon rail top (Nexus sidebar-top pattern): **logo button only** opens a glass portal dropdown to the right (square corners). Hover on the logo shows the full path; the menu lists recent workspaces with a checkmark on the active entry and **Open Folder…**. The status bar left shows the current workspace basename and git branch as read-only context (no switch action). Top bar and main body stay clean (panel toggle + section title only). Rail bottom is Settings only.
129129
- **Switch / open**: `POST /api/workspaces/open` or `PUT /api/settings` with a new `workspace_root`. Triggers `ensure_workspace`, harness restart, terminal reconnect, file index refresh, org/model context reload, and graph rescaffold.
130130
- **Recent list**: `recent_workspaces` setting (JSON array, max 10 paths). Updated on every open/switch.
131131
- **First run**: `maybe_upgrade_workspace_setting()` auto-detects `~/abi` (git + `.env`) when still on the factory default.
@@ -200,7 +200,7 @@ Scaffolded `instances.ttl` seeds concrete routing individuals:
200200
**Iteration 8** (current):
201201

202202
- **Events rail section**: dedicated `#events` main view with full-height process events table (`GET /api/processes`); row click opens detail panel, double-click or **View in Graph** navigates to Graph Overview and focuses the process node
203-
- Workspace logo switcher moved to rail bottom (above Settings); rail top is spacer only
203+
- Workspace logo switcher at rail top (Nexus sidebar-top pattern); rail bottom is Settings only
204204
- Graph Overview tab: vis-network canvas only (process events table removed from split view above graph)
205205
- Tables tab still shows raw SQLite dumps (`processes`, `process_aspects`) for debugging
206206

libs/naas-abi/naas_abi/apps/desktop/gui/web/index.html

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,7 @@
1212
<div id="app-shell">
1313
<!-- Icon rail (Nexus Sidebar, collapsed w-14) -->
1414
<nav id="rail" class="glass">
15-
<div class="rail-top" aria-hidden="true"></div>
16-
<div class="rail-nav">
17-
<button class="rail-btn active" data-section="chat" title="Chat" data-icon="message-square"></button>
18-
<button class="rail-btn" data-section="code" title="Code" data-icon="code-xml"></button>
19-
<button class="rail-btn" data-section="graph" title="Knowledge Graph" data-icon="waypoints"></button>
20-
<button class="rail-btn" data-section="events" title="Events" data-icon="scroll-text"></button>
21-
</div>
22-
<div class="rail-bottom">
15+
<div class="rail-top">
2316
<button
2417
id="workspace-switcher"
2518
class="workspace-switcher"
@@ -30,6 +23,14 @@
3023
>
3124
<img id="workspace-logo" src="/static/assets/abi-logo.png" alt="ABI" width="28" height="28" />
3225
</button>
26+
</div>
27+
<div class="rail-nav">
28+
<button class="rail-btn active" data-section="chat" title="Chat" data-icon="message-square"></button>
29+
<button class="rail-btn" data-section="code" title="Code" data-icon="code-xml"></button>
30+
<button class="rail-btn" data-section="graph" title="Knowledge Graph" data-icon="waypoints"></button>
31+
<button class="rail-btn" data-section="events" title="Events" data-icon="scroll-text"></button>
32+
</div>
33+
<div class="rail-bottom">
3334
<button class="rail-btn" data-section="settings" title="Settings" data-icon="settings"></button>
3435
</div>
3536
</nav>

libs/naas-abi/naas_abi/apps/desktop/gui/web/shell_ui_test.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,22 @@ def _read(name: str) -> str:
3737
return (WEB_DIR / name).read_text(encoding="utf-8")
3838

3939

40-
def test_rail_logo_workspace_switcher_in_bottom() -> None:
40+
def test_rail_logo_workspace_switcher_in_top() -> None:
4141
html = _read("index.html")
4242
assert 'id="workspace-switcher"' in html
4343
assert 'id="workspace-logo"' in html
4444
assert 'id="workspace-name"' not in html
4545
assert "workspace-switcher-label" not in html
4646
assert "workspace-chevron" not in html
47-
rail_bottom_start = html.index('class="rail-bottom"')
47+
rail_top_start = html.index('class="rail-top"')
4848
rail_nav_start = html.index('class="rail-nav"')
49+
rail_bottom_start = html.index('class="rail-bottom"')
4950
workspace_idx = html.index('id="workspace-switcher"')
5051
settings_idx = html.index('data-section="settings"')
51-
assert rail_nav_start < workspace_idx
52-
assert workspace_idx < settings_idx
53-
assert html.index('class="rail-bottom"', rail_bottom_start) == rail_bottom_start
54-
assert workspace_idx > rail_bottom_start
55-
assert 'class="rail-top"' in html
56-
rail_top_end = html.index("</div>", html.index('class="rail-top"'))
57-
assert html.index('id="workspace-switcher"') > rail_top_end
52+
assert rail_top_start < workspace_idx < rail_nav_start
53+
assert rail_nav_start < settings_idx
54+
assert workspace_idx < rail_bottom_start
55+
assert 'aria-hidden="true"' not in html[html.index('class="rail-top"'):rail_nav_start]
5856

5957

6058
def test_status_bar_shows_workspace_name() -> None:
@@ -93,7 +91,7 @@ def test_workspace_switcher_css_logo_button() -> None:
9391
css = _read("style.css")
9492
assert ".glass-card" in css
9593
assert ".workspace-switcher" in css
96-
assert ".rail-bottom .workspace-switcher" in css
94+
assert ".rail-top" in css
9795
assert "workspace-switcher-label" not in css
9896
assert "#workspace-name" not in css
9997

libs/naas-abi/naas_abi/apps/desktop/gui/web/style.css

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,11 @@ svg.icon { flex-shrink: 0; }
111111
}
112112

113113
.rail-top {
114-
height: 12px;
114+
height: 56px;
115115
flex-shrink: 0;
116+
display: flex;
117+
align-items: center;
118+
justify-content: center;
116119
}
117120

118121
.rail-bottom {
@@ -125,10 +128,6 @@ svg.icon { flex-shrink: 0; }
125128
border-top: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
126129
}
127130

128-
.rail-bottom .workspace-switcher {
129-
margin-bottom: 4px;
130-
}
131-
132131
#workspace-logo {
133132
width: 100%;
134133
height: 100%;

0 commit comments

Comments
 (0)