|
130 | 130 | } |
131 | 131 | } |
132 | 132 |
|
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 |
134 | 135 | export function setCursorIndex(index: number) { |
135 | 136 | cursorIndex = Math.max(0, Math.min(index, hosts.length - 1)) |
136 | 137 | scrollToIndex(cursorIndex) |
137 | 138 | } |
138 | 139 |
|
139 | 140 | /** Find a host by name, returns its index or -1. */ |
| 141 | + // noinspection JSUnusedGlobalSymbols -- used dynamically |
140 | 142 | export function findItemIndex(name: string): number { |
141 | 143 | return hosts.findIndex((h) => h.name.toLowerCase() === name.toLowerCase()) |
142 | 144 | } |
143 | 145 |
|
144 | 146 | // Handle keyboard navigation |
| 147 | + // noinspection JSUnusedGlobalSymbols -- used dynamically |
145 | 148 | export function handleKeyDown(e: KeyboardEvent): boolean { |
146 | 149 | if (hosts.length === 0) return false |
147 | 150 |
|
|
395 | 398 | Searching... |
396 | 399 | </div> |
397 | 400 | {: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> |
399 | 407 | {/if} |
400 | 408 | </div> |
401 | 409 |
|
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} |
405 | 415 | </div> |
406 | 416 |
|
407 | 417 | <style> |
|
494 | 504 |
|
495 | 505 | .empty-state { |
496 | 506 | display: flex; |
| 507 | + flex-direction: column; |
497 | 508 | align-items: center; |
498 | 509 | 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); |
500 | 529 | color: var(--color-text-tertiary); |
501 | | - font-style: italic; |
| 530 | + text-align: center; |
502 | 531 | } |
503 | 532 |
|
504 | 533 | .col-shares.is-fetching { |
|
0 commit comments