Skip to content

Add page-level share button with referral ID#1050

Open
Copilot wants to merge 2 commits intomainfrom
copilot/add-share-button-with-referral-id
Open

Add page-level share button with referral ID#1050
Copilot wants to merge 2 commits intomainfrom
copilot/add-share-button-with-referral-id

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 2, 2026

Section anchor links already append ?rid=<referralId> when copied, but there was no way to share the page URL itself with a referral ID attached.

Changes

  • useSiteShell.js

    • Extracted addReferralIdToUrl(url) helper — eliminates duplicated referral ID injection logic
    • Extracted writeToClipboard(url, successMessage?) helper — shared by both copy functions
    • Added shareCurrentPage() — copies current page URL (no hash) with referral ID as ?rid=... if available; exposed in composable return
  • PageNavigation.vue

    • Added a centered fa-solid fa-share-from-square button between prev/next arrows
    • Rendered only on content pages (v-if="shell.isContentPage")
    • Calls shareCurrentPage() on click with a "Share Page" tooltip
  • styles.css

    • Added .tooltip-center for the share button tooltip positioning
    • Added border/padding reset for <button>.arrow-btn to match <a> sibling appearance

Agent-Logs-Url: https://github.com/IntelliTect/EssentialCSharp.Web/sessions/1b04636e-1e3d-4243-a8a5-9f9d3afa169b

Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com>
Copilot AI changed the title [WIP] Add share button to page with referral id Add page-level share button with referral ID May 2, 2026
Copilot AI requested a review from BenjaminMichaelis May 2, 2026 10:44
@BenjaminMichaelis BenjaminMichaelis marked this pull request as ready for review May 2, 2026 19:50
Copilot AI review requested due to automatic review settings May 2, 2026 19:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a page-level “Share” action to copy the current page URL (without hash) with the referral ID (rid) appended when available, aligning page sharing behavior with existing section-link sharing.

Changes:

  • Refactors clipboard/referral URL handling into shared helpers and introduces shareCurrentPage() in useSiteShell.js.
  • Adds a centered share button to the page navigation UI (content pages only).
  • Updates CSS to support centered tooltip positioning and button styling parity with existing nav arrows.

Reviewed changes

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

File Description
EssentialCSharp.Web/wwwroot/css/styles.css Adds centered tooltip positioning and button reset styles for the new share control.
EssentialCSharp.Web/src/composables/useSiteShell.js Extracts referral/clipboard helpers and adds shareCurrentPage() to copy the page URL with rid.
EssentialCSharp.Web/src/components/PageNavigation.vue Introduces a share button between prev/next navigation arrows and wires it to shareCurrentPage().
Comments suppressed due to low confidence (1)

EssentialCSharp.Web/src/composables/useSiteShell.js:112

  • The error snackbar message uses string interpolation on the raw error object, which often renders as [object DOMException] and isn’t helpful to users. Consider surfacing a friendlier message (e.g., error.message when available) while keeping the detailed object in console.error.
                (error) => {
                    console.error("Could not copy text to clipboard: ", error);
                    snackbarColor.value = "red";
                    snackbarMessage.value = `Error: Could not copy text to clipboard: ${error}`;
                }

Comment on lines 100 to 123
@@ -129,6 +122,25 @@ export function useSiteShell() {
}, 3000);
}
</span>
</div>
<div v-if="shell.isContentPage" class="turn-page-tooltip">
<button id="share-btn" class="arrow-btn" aria-label="Share this page" @click="shell.shareCurrentPage()">
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.

Add share button to page that includes referral id

3 participants