Skip to content

Drawer copy button copies the path the drawer shows (#439) - #447

Merged
lstein merged 2 commits into
masterfrom
lstein/fix/copy-path-matches-drawer
Nov 30, 2026
Merged

lstein merged 2 commits into
masterfrom
lstein/fix/copy-path-matches-drawer

Conversation

@lstein

@lstein lstein commented Nov 30, 2026

Copy link
Copy Markdown
Owner

Fixes #439.

What changed

  • Copies the displayed path. The titlebar copy button now copies the text of #filepathText. It used to copy data-filepath from 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.
  • No checkmark when there's nothing to copy. An empty path copies nothing and shows no checkmark. A rejected clipboard write also shows none.
  • Handler moved out of control-panel.js into metadata-drawer.js, which owns the path line. It is delegated from document, like the details-table copy icons.
  • One shared checkmark helper for the path button and the details-table .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

  • 5 new Jest cases in 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.
  • Tested in the browser by the author.
  • Adversarial fresh-context review run. It found no defects in the diff. Its only finding was the stale grid drawer above, which Grid view: stop the drawer showing the previous tile while metadata loads (#438) #446 covers.

🤖 Generated with Claude Code

lstein and others added 2 commits November 29, 2026 20:57
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>
@lstein
lstein enabled auto-merge (squash) November 30, 2026 02:05
@lstein
lstein merged commit 1c7c185 into master Nov 30, 2026
11 checks passed
@lstein
lstein deleted the lstein/fix/copy-path-matches-drawer branch November 30, 2026 02:24
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.

Drawer copy-path button can copy a different path than the one displayed

1 participant