Skip to content

Conversation

@stevenvo
Copy link
Contributor

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

  • Open code file in preview
  • Modify file externally
  • Click refresh button -> sees updated content
  • Test with markdown, PDF, image files
  • Verify button appears in header

🤖 Generated with Claude Code

Adds refresh icon buttons to all file preview types (code editor, markdown, PDFs, images) allowing users to reload file content from disk without closing and reopening the preview.

- Added refresh button to preview header icon buttons
- Implemented refreshCallback in all preview components
- Made fullFileAtom reactive to refreshVersion changes
- Works for: code files, markdown, PDFs, images, videos, audio

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@CLAassistant
Copy link

CLAassistant commented Dec 15, 2025

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 15, 2025

Warning

Rate limit exceeded

@stevenvo has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 8 minutes and 54 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between fbb0c4d and 0671f0c.

📒 Files selected for processing (4)
  • frontend/app/view/preview/preview-edit.tsx (1 hunks)
  • frontend/app/view/preview/preview-markdown.tsx (1 hunks)
  • frontend/app/view/preview/preview-model.tsx (2 hunks)
  • frontend/app/view/preview/preview-streaming.tsx (2 hunks)

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +50 to +53
useEffect(() => {
model.refreshCallback = () => {
globalStore.set(model.refreshVersion, (v) => v + 1);
};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Streaming refresh button performs no reload

In StreamingPreview the refresh callback merely increments refreshVersion, but that atom is never read when building the streaming URL or rendering the media, so clicking the new refresh icon causes no re-render or cache-busting. For PDFs/images/audio/video the button therefore does nothing—content stays stale unless the path/connection changes—undermining the new manual refresh feature for all streaming file types.

Useful? React with 👍 / 👎.

@stevenvo stevenvo force-pushed the feature/preview-refresh-buttons branch from de33e97 to 0671f0c Compare December 15, 2025 04:22
@sawka sawka merged commit 72feb72 into wavetermdev:main Dec 15, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants