Repository navigation
Avoid sentence-ending periods in clipboard links - #13706
Inference1 wants to merge 2 commits into
Conversation
|
Would you please review this pr |
Tested commit Verification Summary
Verification outputThe implementation is minimal, cleanly isolates sentence punctuation from standalone links, and includes good regression coverage.
|
|
Thanks for the independent verification. The baseline reproduction and PR-branch checks are very helpful. I’m happy to keep the review on this PR. |
|
@omarchybot Would you please check and confirm whether it can be merged |
An entry of only a URL plus spaces, such as "https://example.com/file. ", counted as more than the URL, so its literal trailing period was stripped. Compare against the entry with surrounding whitespace ignored instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
| if [[ -n $url && $url == *. && ! $text =~ ^[[:space:]]*"$url"[[:space:]]*$ ]]; then | ||
| url=${url%.} |
There was a problem hiding this comment.
When prose contains a URL whose path genuinely ends in a period, such as Download https://example.com/file. from here, this check removes that period because the URL has surrounding text. The browser receives https://example.com/file instead of the linked address, potentially opening a different resource.
|
Reviewed and verified on a disposable Omarchy worker. The fix is sound, and I pushed one small correction to your branch. Reproduction. I ran What I changed (2244eba). An entry of only a URL plus surrounding whitespace, such as Tests. Second opinion. Codex at medium effort reviewed it twice. Round one found the whitespace case above, which I hadn't caught on my own. Round two checked the correction, including that the quoted Greptile's comment on line 44 ( Overlap. #11920 rewrites how this command reads the history entry ( This is now waiting on the maintainer. |
|
@omarchybot merge-ready |
|
@omarchybot Please help me ask the maintainer to take a look and advise on how to merge it in. |
|
when to merge |
|
merge this |
Problem
Opening a clipboard text entry containing a sentence such as
See https://example.com/docs.currently passeshttps://example.com/docs.to the browser. The final period belongs to the sentence, butomarchy-clipboard-openincludes it in the URL path, which may open a different page. The existing clipboard test covers a standalone URL, not a link embedded in prose. There is no linked issue for this locally reproduced case.To reproduce through the UI, copy that sentence, open it from clipboard history, and inspect the browser address. The expected address is
https://example.com/docs.Change
The command now removes one trailing period from an extracted URL when the clipboard entry contains more than the URL itself. This keeps the fix focused on sentence punctuation:
See https://example.com/docs.https://example.com/docshttps://example.com/file.https://example.com/file.https://example.com/docs?q=a.bhttps://example.com/docs?q=a.bText without a URL still opens in the editor. URL discovery order, bare-domain fallback, and clipboard history contents are unchanged.
Validation
test/shell.d/clipboard-open-test.sh, which runs the real command with a temporary home and stubs onlyjq, the browser, and the editor. Before the production change, the target assertion failed withgot: https://example.com/docs.. After the change, all four checks pass in Git Bash and Ubuntu 24.04 WSL (Bash 5.2.21), including the plain-text editor path.bash -n bin/omarchy-clipboard-open test/shell.d/clipboard-open-test.sh: pass.bash bin/omarchy commands --check: pass (469 commands).git diff --check: pass../test/allin an Ubuntu 24.04 temporary checkout: not passing in this environment. The patched checkout failed 127/287 Shell test files; the unmodified checkout failed 128/286 in the same environment. The new test passed inside the aggregate run, and no test file failed only with this change. The environment lacks Node, jq, lua, socat, magick, Omarchy-specific services, and the companion packaging checkout.I could not perform an end-to-end clipboard UI check because this machine has no Omarchy desktop session.