Repository navigation
Drawer copy button copies the path the drawer shows (#439) - #447
Merged
Merged
Conversation
The titlebar copy button looked up `.swiper-slide[data-global-index=N]` and copied its data-filepath. In grid view that could be a placeholder tile or a hidden swiper slide, so it copied an empty or different path than the one shown beside it, under the success checkmark. Move the handler into metadata-drawer.js and copy #filepathText's text. Copy nothing (and show no checkmark) when no path is displayed. Share one checkmark helper with the details-table copy icons; it restores the original icon correctly on a second copy within the flash window. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #439.
What changed
#filepathText. It used to copydata-filepathfrom the first.swiper-slide[data-global-index=N]. In grid view that could be a placeholder tile or a hidden swiper slide, so it copied an empty or different path while still showing the success checkmark.control-panel.jsintometadata-drawer.js, which owns the path line. It is delegated fromdocument, like the details-table copy icons..copy-icons. It fixes two existing bugs: a second copy within the one-second flash left the checkmark stuck in place of the icon, and the path button's checkmark was drawn inside its existing icon instead of replacing it.Related
Copying what the drawer shows is only correct if the drawer is up to date. In grid view it can still show the previous tile's path while the selected tile's metadata loads, or after the last image is deleted. Those cases are fixed separately in #446 (#438).
Testing
metadata-drawer-file-info.test.js: a slide carrying a different path is ignored; an empty path copies nothing; a click on the icon copies; a double copy restores the icon; a failed write shows no checkmark. Full suite (1156), lint and format pass.🤖 Generated with Claude Code