8000 fix(web): support clipboard copy over HTTP by HuLunTunTao · Pull Request #872 · felinics/Memoh · GitHub
[go: up one dir, main page]

Skip to content

fix(web): support clipboard copy over HTTP - #872

Merged
chen-ran merged 8 commits into
felinics:mainfrom
HuLunTunTao:fix/clipboard-fallbacks
Jul 30, 2026
Merged

chen-ran merged 8 commits into
felinics:mainfrom
HuLunTunTao:fix/clipboard-fallbacks

Conversation

@HuLunTunTao
@HuLunTunTao HuLunTunTao commented Jul 28, 2026 •
Copy link
Copy Markdown
Contributor

Summary

Fixes copy failures over plain HTTP across the Web UI:

  • Connected Accounts link codes
  • Chat code blocks
  • Bot diagnostic details
  • Channel webhook URLs
  • User IDs

All five paths now use the shared useClipboard() fallback and report copy failures. The UI submodule includes the focus-trap-safe fallback from felinics/ui#11, so dialog copy no longer needs a page-level workaround.

Verification

  • ESLint on the five changed Vue files
  • pnpm --filter @felinic/ui build
  • pnpm --filter @memohai/web build

Fixes #871

Copilot AI left a comment
Copy link
Copy Markdown
Contributor

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 clipboard copy failures when the Web UI is accessed over plain HTTP (non-secure context) by routing copy actions through the existing useClipboard() utility (which provides fallback behavior) and surfacing a user-facing error toast when copying still fails, addressing issue #871.

Changes:

  • Update “Connected Accounts” link-code copy to use useClipboard().copyText() instead of navigator.clipboard.writeText().
  • Update Chat code-block copy to use useClipboard().copyText() and display common.copyFailed on failure.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
apps/web/src/pages/profile/components/connected-accounts-section.vue Uses useClipboard().copyText() for /link <code> copying and shows a localized error toast if copying fails over HTTP.
apps/web/src/pages/home/components/chat-code-block.vue Uses useClipboard().copyText() for code-block copy and shows a localized error toast if copying fails over HTTP.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chen-ran
Copy link
Copy Markdown
Member

The fix looks right for the two reported paths, but the same HTTP issue remains in bot-checks-panel.vue, channel-settings-panel.vue, and profile/index.vue, which still call navigator.clipboard.writeText() directly. It had best to fix it all.

@HuLunTunTao
Copy link
8000 Copy Markdown
Contributor Author

These cases you mentioned have been fixed in the latest 4 commits.
In bot-checks-panel.vue I used a temporary workaround, because the HTTP fallback in useClipboard() does not work inside a focus-trapped dialog.
Fixing this would require a separate change to useClipboard in memohai/ui.

@chen-ran chen-ran changed the title fix(web): support link-code and chat code copy over HTTP fix(web): support clipboard copy over HTTP Jul 30, 2026
@chen-ran
chen-ran merged commit b62ac0d into felinics:main Jul 30, 2026
13 checks passed
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]: Copy actions fail when accessing Memoh over HTTP

3 participants

0