Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@boydaihungst
Copy link
Contributor

Fixes: #3066

@sxyazi sxyazi changed the title fix: prevent PDF out-of-range error message from overlapping preview image fix: erase overlapping image portions when previewing errors Aug 18, 2025
@sxyazi sxyazi requested a review from Copilot August 18, 2025 11:50
Copy link
Owner

@sxyazi sxyazi left a comment

Choose a reason for hiding this comment

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

Thank you

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue where overlapping image portions remain visible when previewing errors in the Yazi file manager. The fix ensures that error messages properly clear the display area before rendering.

  • Modifies error rendering to explicitly clear the display area before showing error text
  • Updates PDF plugin to handle page bounds more efficiently by returning bound information from preload
  • Simplifies image plugin error handling by removing redundant area and wrap specifications

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
yazi-plugin/src/utils/preview.rs Adds explicit area clearing before rendering error messages
yazi-plugin/preset/plugins/pdf.lua Refactors page bound handling to return bound info from preload function
yazi-plugin/preset/plugins/image.lua Simplifies error handling by removing redundant UI specifications
yazi-binding/src/elements/renderable.rs Adds with_area method and updates Error conversion to remove area coupling

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


use super::{Bar, Border, Clear, Gauge, Line, List, Table, Text};
use crate::{Error, elements::{Area, Rect}};
use crate::{Error, elements::Area};
Copy link

Copilot AI Aug 18, 2025

Choose a reason for hiding this comment

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

The removed import Rect might still be needed elsewhere in the file. Verify that all usages of Rect have been properly addressed or replaced with Area.

Copilot uses AI. Check for mistakes.
@sxyazi sxyazi merged commit a419312 into sxyazi:main Aug 18, 2025
6 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PDF out-of-range error message overlapped preview image

2 participants