Skip to content

Fix pages build: restore missing files dropped in merge#196

Merged
kiyarose merged 2 commits intokr/expagefrom
copilot/fix-pages-job-failure
Mar 26, 2026
Merged

Fix pages build: restore missing files dropped in merge#196
kiyarose merged 2 commits intokr/expagefrom
copilot/fix-pages-job-failure

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 26, 2026

The merge of #195 left the branch in a non-building state due to several files either truncated, corrupted, or entirely missing.

Changes

ContactSection.tsx

  • Restored the const rawTurnstileSiteKey = declaration — the assignment line and the VITE_TURNSTILE_SITE_KEY lookup were silently dropped, leaving dangling expression statements (TS1005/TS1109)
- const DEFAULT_TURNSTYLE_SITE_KEY = "";
-     import.meta.env.VITE_TURNSTYLE_SITE ??
+ const DEFAULT_TURNSTYLE_SITE_KEY = "";
+ const rawTurnstileSiteKey =
+   (import.meta.env.VITE_TURNSTILE_SITE_KEY ??
+     import.meta.env.VITE_TURNSTYLE_SITE ??

SkillsSection.tsx

  • Fixed <SectionHeader> with three conflicting eyebrow props (TS17001) — collapsed to a single eyebrow={t.skills.eyebrow}
  • Added missing icon prop
  • Added missing const { t } = useTranslation() call (imported but never invoked, so t was undefined)

Missing hooks (imported by App.tsx / MobileNav.tsx, absent from tree)

  • src/hooks/useAnimatedScroll.ts
  • src/hooks/useBodyScrollLock.ts

Missing translations (imported by src/translations/index.ts, absent from tree)

  • ca.json, fr.json, nl.json, ja.json, ru.json

All restored from kiyarose/Portf reference.

@kiyarose kiyarose marked this pull request as ready for review March 26, 2026 10:53
Copilot AI review requested due to automatic review settings March 26, 2026 10:53
@kiyarose kiyarose merged commit 75e401f into kr/expage Mar 26, 2026
17 checks passed
@kiyarose kiyarose deleted the copilot/fix-pages-job-failure branch March 26, 2026 10:57
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

Restores files and fixes regressions that left the Vite + React + TypeScript site in a non-building state after a merge, by reintroducing missing hooks/translations and repairing truncated section code.

Changes:

  • Fixes build-breaking issues in ContactSection.tsx (restored Turnstile site key assignment) and SkillsSection.tsx (restored useTranslation() usage and corrected <SectionHeader> props).
  • Restores missing hooks used by navigation (useAnimatedScroll, useBodyScrollLock).
  • Restores missing locale JSON files referenced by the translations index (ca, fr, nl, ja, ru).

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/sections/ContactSection.tsx Restores the Turnstile site key assignment chain so the module parses/builds correctly.
src/sections/SkillsSection.tsx Fixes missing translation hook usage and corrects/normalizes SectionHeader props.
src/hooks/useAnimatedScroll.ts Reintroduces animated (fade) scrolling used by header/mobile nav.
src/hooks/useBodyScrollLock.ts Reintroduces body scroll locking used by the mobile nav overlay.
src/translations/ca.json Restores Catalan translations referenced by src/translations/index.ts.
src/translations/fr.json Restores French translations referenced by src/translations/index.ts.
src/translations/nl.json Restores Dutch translations referenced by src/translations/index.ts.
src/translations/ja.json Restores Japanese translations referenced by src/translations/index.ts.
src/translations/ru.json Restores Russian translations referenced by src/translations/index.ts.

Comment on lines +30 to +44
// For reduced motion, use instant browser scroll
if (prefersReducedMotion) {
element.scrollIntoView({ behavior: "auto", block: "start" });
return;
}

const main = document.querySelector("main");
if (!main) {
element.scrollIntoView({ behavior: "auto", block: "start" });
return;
}

const targetPosition =
element.getBoundingClientRect().top + window.scrollY + offset;

Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

offset is ignored when prefersReducedMotion is true (and also when falling back to scrollIntoView because <main> isn’t found). Since call sites pass offset: -80 for a sticky header, reduced-motion users can end up with the target section hidden under the header. Consider computing the target Y position and using window.scrollTo({ top: ..., behavior: "auto" }) in these branches as well so offset is consistently honoured.

Suggested change
// For reduced motion, use instant browser scroll
if (prefersReducedMotion) {
element.scrollIntoView({ behavior: "auto", block: "start" });
return;
}
const main = document.querySelector("main");
if (!main) {
element.scrollIntoView({ behavior: "auto", block: "start" });
return;
}
const targetPosition =
element.getBoundingClientRect().top + window.scrollY + offset;
const targetPosition =
element.getBoundingClientRect().top + window.scrollY + offset;
// For reduced motion, use instant browser scroll while still respecting offset
if (prefersReducedMotion) {
window.scrollTo({ top: targetPosition, behavior: "auto" });
return;
}
const main = document.querySelector("main");
if (!main) {
window.scrollTo({ top: targetPosition, behavior: "auto" });
return;
}

Copilot uses AI. Check for mistakes.
Comment on lines +58 to +62
// Trigger reflow to ensure style changes are applied
// eslint-disable-next-line @typescript-eslint/no-unused-expressions

// Phase 3: Fade in the target content with scale effect
requestAnimationFrame(() => {
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

There’s a "Trigger reflow" comment followed by an eslint-disable-next-line @typescript-eslint/no-unused-expressions, but no statement on the next line. This is misleading and makes it unclear whether a reflow was intended; either add the actual reflow trigger (e.g., by reading a layout property) or remove the comment/disable directive.

Copilot uses AI. Check for mistakes.
Comment on lines +104 to +108
// Trigger reflow to ensure style changes are applied
// eslint-disable-next-line @typescript-eslint/no-unused-expressions

requestAnimationFrame(() => {
main.style.transform = "scale(1.02)";
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

Same as above in scrollToTop: the reflow comment and eslint-disable-next-line directive aren’t followed by any statement. This should either perform the intended reflow or be removed to avoid dead/misleading lint directives.

Copilot uses AI. Check for mistakes.
*/
export function useAnimatedScroll(options: AnimatedScrollOptions = {}) {
const { duration = 400, offset = 0 } = options;
const prefersReducedMotion = useReducedMotion();
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

Minor consistency: most components in this repo coerce useReducedMotion() to a strict boolean via useReducedMotion() ?? false (e.g. src/components/ScrollSpy.tsx:24). Here it’s assigned directly, so the type/behaviour may differ from the rest of the codebase depending on framer-motion’s return value. Consider matching the existing pattern for consistency.

Suggested change
const prefersReducedMotion = useReducedMotion();
const prefersReducedMotion = useReducedMotion() ?? false;

Copilot uses AI. Check for mistakes.
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.

3 participants