Skip to content

Consolidate contact displays into a unified parameterized component#61

Merged
Sparkier merged 1 commit into
mainfrom
jules/unified-contact-component-js0-00a60be6-48a0-41a8-8c35-207f4cfc8c90
Jul 18, 2026
Merged

Consolidate contact displays into a unified parameterized component#61
Sparkier merged 1 commit into
mainfrom
jules/unified-contact-component-js0-00a60be6-48a0-41a8-8c35-207f4cfc8c90

Conversation

@google-labs-jules

Copy link
Copy Markdown
Contributor

Why

Previously, displaying contact details on the main portfolio page and the CV/resume page relied on two separate Svelte components. This duplication introduced a maintenance bottleneck, high risk of visual drift, and split control over how profile links were handled.

To address this, we consolidated the display logic into a single, unified, and highly configurable component. This ensures a single source of truth for user profile data while preserving distinct rendering behaviors across channels (e.g., standard web browsing vs. static PDF output).


Key Decisions & Architecture

  1. Svelte 5 Reactivity ($props):
    We introduced two parameters to control layout behaviors dynamically:
    • variant ('icon-only' | 'labeled'): Customizes layout structure and elements.
    • showLinks (boolean): Dynamically deactivates interactive hyperlinks when printing or generating PDFs, ensuring clean, underline-free printed assets.
  2. Layout & Ordering Rules:
    • icon-only Mode: Geared toward web visitors. Renders standard social platforms in a tight, centered, label-free row.
    • labeled Mode: Geared toward employers and recruiters reading the resume. Renders with full text handles, a flexible wrapping container, and a restructured sequence that prioritizes mailing location first and academic portfolios last.
  3. Print-Safe Interaction Bypass:
    When showLinks is set to false, the component bypasses rendering anchor (<a>) wrappers entirely, preventing visual noise and broken links on generated PDF outputs while keeping the underlying text fully readable.

What Changed

  • Refactored src/lib/components/Contact.svelte:
    • Implemented Svelte 5 dynamic props (variant, showLinks).
    • Added order-mapping arrays and CSS class toggles to transition smoothly between a tight horizontal bar and a flexible wrapped layout block.
  • Updated src/routes/cv/+page.svelte:
    • Replaced the deprecated CV contact import with the unified component: <Contact variant="labeled" {showLinks} />.
  • Deleted Redundant Code:
    • Safely removed the legacy duplicate file src/lib/components/cv/Contact.svelte.

@Sparkier
Sparkier merged commit 447aa6e into main Jul 18, 2026
1 check passed
@Sparkier
Sparkier deleted the jules/unified-contact-component-js0-00a60be6-48a0-41a8-8c35-207f4cfc8c90 branch July 18, 2026 09:36
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