Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: close selected preview on single click #848

Merged

Conversation

thatdevsherry
Copy link
Contributor

@thatdevsherry thatdevsherry commented Mar 4, 2025

Fixes #834

Use matches! to compare b/w ContextPage::Preview as first pressing on "Close" button would fail the equality check b/w Preview(None, _) and Preview(Some(entity),_).

This fixes the two clicks needed to close Preview of Selected as first click would update self.context_page from Preview(None,..) to Preview(Some,..) and next click would pass equality and close Preview.

EDIT: prev. implementation was changing self.context_page from None to Some in Preview which fixed the original issue, but the persist preview would still require two clicks to close.

Newer commit fixes original issue + fixes two clicks required on persisted preview as well.

set context_page to preview with Some(entity) instead of None when "Show
details" is selected.

Preview of None entity would fail first equality check in
Message::ToggleContextPage as `Preview(None, ..) != Preview(Some, ..)`
.

This fixes the two clicks needed to close Preview of Selected as first
click would update self.context_page from Preview(None,..) to
Preview(Some,..) and next click would pass equality and close Preview.
match on Preview (the type) to close preview context in single click.

matching on Preview type prevents the equality check failing b/w
ContextPage::Preview(Some,_) and ContextPage::Preview(None,_)
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.

[BUG] Close button on details panel needs to be hit twice
2 participants