Skip to content

feat(ui): GitHub-issue feedback icon + tour step#13

Merged
satra merged 1 commit into
mainfrom
feat/feedback-icon
May 17, 2026
Merged

feat(ui): GitHub-issue feedback icon + tour step#13
satra merged 1 commit into
mainfrom
feat/feedback-icon

Conversation

@satra

@satra satra commented May 17, 2026

Copy link
Copy Markdown
Collaborator

Header gets a speech-bubble icon between About and the theme toggle. Clicking opens a pre-filled GitHub issue (page URL + deploy SHA + user-agent templated in). Issues land under the feedback label.

Tour gets an eighth step on the home tour pointing at the icon.

New header affordance — a speech-bubble icon between the About link
and the theme toggle. Clicking opens a pre-filled GitHub issue in a
new tab, with the issue body templating:

  - current page URL ($page.url.href, reactive across navigation)
  - deploy build SHA from envBuildInfo / dataBuildInfo
  - browser user-agent

Issues are auto-labelled `feedback` via the query-string. The body
includes a three-question template (what were you doing / what
happened / what did you expect) so reporters have a frame and
maintainers have the minimum context to reproduce.

Tour: added an eighth step on the home tour right after "About +
methodology" that attaches to the icon and explains it. Detail / about
tours don't need their own step — the icon's behaviour is identical
across routes (just templates a different URL into the body).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@satra
satra temporarily deployed to pr-preview-13 May 17, 2026 22:45 — with GitHub Actions Inactive
@satra
satra merged commit 6786326 into main May 17, 2026
2 checks passed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a feedback mechanism by adding a GitHub issue link to the site header, complete with a reactive URL generator that pre-fills issue details such as the current page, build SHA, and user agent. Additionally, a new step has been added to the site tour to highlight this feature. Feedback suggests refactoring the URL construction logic into a dedicated utility for improved maintainability and utilizing SvelteKit's browser environment variable for more idiomatic client-side checks.

Comment on lines +23 to +51
$: feedbackUrl = (() => {
const sha =
envBuildInfo?.code_revision_short ??
dataBuildInfo?.code_revision_short ??
'(unknown)';
const here = $page.url.href;
const ua = typeof navigator !== 'undefined' ? navigator.userAgent : '';
const body = [
'<!-- Replace this template with your bug report or feature request. -->',
'',
'## What were you doing?',
'',
'## What happened?',
'',
'## What did you expect?',
'',
'---',
'',
`- page: ${here}`,
`- build: \`${sha}\``,
`- user-agent: ${ua}`
].join('\n');
const params = new URLSearchParams({
labels: 'feedback',
title: '[feedback] ',
body
});
return `https://github.com/${FEEDBACK_REPO}/issues/new?${params.toString()}`;
})();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The logic for constructing the GitHub issue URL is currently embedded directly within a reactive block in the layout. While functional, this logic is quite verbose and could be extracted into a dedicated helper function or a derived store in a separate utility file (e.g., $lib/feedback.ts). This would improve the maintainability and testability of the layout component, which already handles complex SPA redirect logic.

dataBuildInfo?.code_revision_short ??
'(unknown)';
const here = $page.url.href;
const ua = typeof navigator !== 'undefined' ? navigator.userAgent : '';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

For SvelteKit applications, it is more idiomatic to use the browser boolean from $app/environment to guard client-side only globals like navigator. This ensures consistent behavior across SSR and hydration.

const ua = browser ? navigator.userAgent : '';

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.

1 participant