Commit 72feb72
Add manual refresh buttons to file preview (#2680)
## Summary
Adds refresh icon buttons to all file preview types, allowing users to
reload file content from disk without closing and reopening the preview.
## Problem
When files are modified externally (by another editor, git operations,
build tools), the Wave Terminal file preview doesn't automatically
update. Users had to close and reopen the preview to see changes.
## Solution
- Added refresh button (rotating arrows icon) to preview header
- Appears for: code files, markdown, PDFs, images, videos, audio
- Clicking refresh reloads the file from disk
- Uses existing refreshCallback pattern (already used by directory
preview)
## Implementation
- Modified preview-model.tsx to add refresh button to endIconButtons
- Made fullFileAtom reactive to refreshVersion changes
- Implemented refreshCallback in all preview components:
- preview-edit.tsx (code editor)
- preview-markdown.tsx (markdown files)
- preview-streaming.tsx (PDFs, images, videos, audio)
## Test Plan
- [x] Open code file in preview
- [x] Modify file externally
- [x] Click refresh button -> sees updated content
- [x] Test with markdown, PDF, image files
- [x] Verify button appears in header
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>1 parent fbb0c4d commit 72feb72
File tree
4 files changed
+41
-2
lines changed- frontend/app/view/preview
4 files changed
+41
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
66 | 69 | | |
67 | 70 | | |
68 | 71 | | |
| 72 | + | |
69 | 73 | | |
70 | 74 | | |
71 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
11 | 19 | | |
12 | 20 | | |
13 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
353 | 369 | | |
354 | 370 | | |
355 | 371 | | |
| |||
408 | 424 | | |
409 | 425 | | |
410 | 426 | | |
| 427 | + | |
411 | 428 | | |
412 | 429 | | |
413 | 430 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
48 | 58 | | |
49 | 59 | | |
50 | 60 | | |
| |||
0 commit comments