Skip to content

Commit 727d025

Browse files
Copilotamide-init
andauthored
Fix GitHub preview repo selection and Three.js bar tooltip vertical alignment (#39)
* fix: repair portfolio preview repos and threejs bar tooltip positioning Agent-Logs-Url: https://github.com/amide-init/gitfolio/sessions/b6cd410b-3698-4194-9ac2-b3a24a558618 Co-authored-by: amide-init <31934584+amide-init@users.noreply.github.com> * refactor: name threejs bar tooltip offset constant Agent-Logs-Url: https://github.com/amide-init/gitfolio/sessions/b6cd410b-3698-4194-9ac2-b3a24a558618 Co-authored-by: amide-init <31934584+amide-init@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: amide-init <31934584+amide-init@users.noreply.github.com>
1 parent abc7e1e commit 727d025

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/components/PortfolioPreviewModal.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ type Props = {
270270
onClose: () => void
271271
}
272272

273-
export function PortfolioPreviewModal({ user, repos: _, allRepos, onClose }: Props) {
273+
export function PortfolioPreviewModal({ user, repos, allRepos, onClose }: Props) {
274274
// Lock body scroll
275275
useEffect(() => {
276276
const prev = document.body.style.overflow
@@ -283,7 +283,7 @@ export function PortfolioPreviewModal({ user, repos: _, allRepos, onClose }: Pro
283283

284284
const hero = buildHero(user, allRepos)
285285
const snapshot = buildSnapshot(user, allRepos)
286-
const repos = buildRepos(allRepos)
286+
const previewRepos = buildRepos(repos.length > 0 ? repos : allRepos)
287287
const stats = buildStats(user, allRepos)
288288

289289
return createPortal(
@@ -328,7 +328,7 @@ export function PortfolioPreviewModal({ user, repos: _, allRepos, onClose }: Pro
328328
<GitHubSection
329329
title="GitHub"
330330
body={`${user.name || user.login}'s public repositories on GitHub.`}
331-
repos={repos}
331+
repos={previewRepos}
332332
/>
333333
<StatsSection stats={stats} />
334334

src/templates/threejs/ThreeBarChart.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ interface ThreeBarChartProps {
1414
}
1515

1616
const EASE_DURATION = 1100 // ms
17+
const TOOLTIP_TOP_OFFSET = 0.1
1718

1819
function easeOutCubic(t: number) {
1920
return 1 - Math.pow(1 - t, 3)
@@ -158,7 +159,7 @@ export default function ThreeBarChart({
158159
if (hoveredIdx >= 0) {
159160
const d = data[hoveredIdx]
160161
const pos3 = bars[hoveredIdx].mesh.position.clone()
161-
pos3.y = bars[hoveredIdx].mesh.scale.y * bars[hoveredIdx].targetH
162+
pos3.y = bars[hoveredIdx].mesh.scale.y + TOOLTIP_TOP_OFFSET
162163
const projected = pos3.clone().project(camera)
163164
setTooltip({
164165
x: ((projected.x + 1) / 2) * w,

0 commit comments

Comments
 (0)