Add page-level share button with referral ID#1050
Conversation
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>
There was a problem hiding this comment.
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()inuseSiteShell.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
errorobject, which often renders as[object DOMException]and isn’t helpful to users. Consider surfacing a friendlier message (e.g.,error.messagewhen available) while keeping the detailed object inconsole.error.
(error) => {
console.error("Could not copy text to clipboard: ", error);
snackbarColor.value = "red";
snackbarMessage.value = `Error: Could not copy text to clipboard: ${error}`;
}
| @@ -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()"> |
…tton Agent-Logs-Url: https://github.com/IntelliTect/EssentialCSharp.Web/sessions/feddee6f-34b7-4743-a528-97a454ce5e28 Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com>
|
Both review comments addressed in a42a4eb:
|
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.jsaddReferralIdToUrl(url)helper — eliminates duplicated referral ID injection logicwriteToClipboard(url, successMessage?)helper — shared by both copy functionsshareCurrentPage()— copies current page URL (no hash) with referral ID as?rid=...if available; exposed in composable returnPageNavigation.vuefa-solid fa-share-from-squarebutton between prev/next arrowsv-if="shell.isContentPage")shareCurrentPage()on click with a "Share Page" tooltipstyles.css.tooltip-centerfor the share button tooltip positioningborder/paddingreset for<button>.arrow-btnto match<a>sibling appearance