Skip to content

Commit a018a3e

Browse files
committed
Design: Make "No network hosts found" screen nicer
- Added a nice SVG anim, too
1 parent 55aba96 commit a018a3e

2 files changed

Lines changed: 87 additions & 7 deletions

File tree

apps/desktop/src/lib/file-explorer/network/NetworkBrowser.svelte

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,18 +130,21 @@
130130
}
131131
}
132132
133-
/** Move cursor to a specific index (used by MCP move_cursor tool). */
133+
/** Move cursor to a specific index. */
134+
// noinspection JSUnusedGlobalSymbols -- used dynamically by MCP move_cursor tool
134135
export function setCursorIndex(index: number) {
135136
cursorIndex = Math.max(0, Math.min(index, hosts.length - 1))
136137
scrollToIndex(cursorIndex)
137138
}
138139
139140
/** Find a host by name, returns its index or -1. */
141+
// noinspection JSUnusedGlobalSymbols -- used dynamically
140142
export function findItemIndex(name: string): number {
141143
return hosts.findIndex((h) => h.name.toLowerCase() === name.toLowerCase())
142144
}
143145
144146
// Handle keyboard navigation
147+
// noinspection JSUnusedGlobalSymbols -- used dynamically
145148
export function handleKeyDown(e: KeyboardEvent): boolean {
146149
if (hosts.length === 0) return false
147150
@@ -395,13 +398,20 @@
395398
Searching...
396399
</div>
397400
{:else if hosts.length === 0}
398-
<div class="empty-state">No network hosts found.</div>
401+
<div class="empty-state">
402+
<img class="empty-icon" src="/icons/network-no-hosts.svg" alt="" />
403+
<div class="empty-title">No network hosts found</div>
404+
<div class="empty-message">Make sure you're on a network with SMB-capable devices.</div>
405+
<Button variant="secondary" onclick={handleRefreshClick}>Refresh</Button>
406+
</div>
399407
{/if}
400408
</div>
401409

402-
<div class="refresh-section">
403-
<Button variant="secondary" onclick={handleRefreshClick}>🔄 Refresh</Button>
404-
</div>
410+
{#if hosts.length > 0}
411+
<div class="refresh-section">
412+
<Button variant="secondary" onclick={handleRefreshClick}>🔄 Refresh</Button>
413+
</div>
414+
{/if}
405415
</div>
406416

407417
<style>
@@ -494,11 +504,30 @@
494504
495505
.empty-state {
496506
display: flex;
507+
flex-direction: column;
497508
align-items: center;
498509
justify-content: center;
499-
padding: 48px var(--spacing-lg);
510+
height: 100%;
511+
padding: var(--spacing-xl);
512+
gap: var(--spacing-md);
513+
color: var(--color-text-secondary);
514+
}
515+
516+
.empty-icon {
517+
width: 96px;
518+
height: 96px;
519+
}
520+
521+
.empty-title {
522+
font-size: var(--font-size-lg);
523+
font-weight: 500;
524+
color: var(--color-text-primary);
525+
}
526+
527+
.empty-message {
528+
font-size: var(--font-size-sm);
500529
color: var(--color-text-tertiary);
501-
font-style: italic;
530+
text-align: center;
502531
}
503532
504533
.col-shares.is-fetching {
Lines changed: 51 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)