Files
Tom MoorandClaude Opus 5.5 28af9890f9 feat: Allow document links to suppress view recording (#14334)
* feat: Allow document links to suppress view recording

Adds a suppressView query parameter that prevents a view from being
recorded when a document is opened, removing it from the URL afterwards
so that copied links record views as normal.

* refactor: Use useConsumeQueryParam to read suppressView

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 11:36:19 -04:00

14 lines
495 B
TypeScript

/** The query parameter that prevents a document view from being recorded. */
export const SuppressViewParam = "suppressView";
/**
* Returns a path to a document that will not record a view when opened, so
* that reviewing activity does not change it.
*
* @param path the frontend path to the document.
* @returns the path with the parameter appended.
*/
export function suppressView(path: string): string {
return `${path}${path.includes("?") ? "&" : "?"}${SuppressViewParam}=true`;
}