Skip to content

[FEAT] 타임박스 탭 진입 시 현재 시각으로 자동 스크롤#239

Merged
kimminna merged 2 commits into
developfrom
feat/web/237-timebox-scroll-to-current-time
Jul 16, 2026
Merged

[FEAT] 타임박스 탭 진입 시 현재 시각으로 자동 스크롤#239
kimminna merged 2 commits into
developfrom
feat/web/237-timebox-scroll-to-current-time

Conversation

@ehye1

@ehye1 ehye1 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

ISSUE 🔗

close #237



What is this PR? 🔍

타임박스 탭에 진입하거나 탭을 전환할 때 현재 시각이 화면 중앙에 오도록 자동 스크롤되게 합니다.

  • TimeSidebar의 timebox 패널 스크롤 컨테이너에 ref 부착
  • activeTab"timebox"로 바뀌거나 사이드바가 열릴 때(isOpen) scrollTo로 현재 시각 위치로 부드럽게 스크롤
  • 현재 시각 offset = (hours + minutes / 60) * 50(ROW_HEIGHT), 컨테이너 높이 절반을 빼서 화면 중앙 정렬



To Reviewers

홈 탭의 "오늘" 버튼 방식(pub/sub + scrollIntoView)과 달리, 타임박스는 이미 currentTimeOffset을 수치로 알고 있어 스크롤 컨테이너에 직접 scrollTo를 호출하는 방식으로 단순하게 구현했습니다.



Screenshot 📷



Test Checklist ✔

  • 앱 최초 진입 시 타임박스 탭이 현재 시각을 중앙에 표시하는지 확인
  • Timer 탭 → Timebox 탭 전환 시 현재 시각으로 부드럽게 스크롤되는지 확인
  • 사이드바 접힘 → 펼침 시 현재 시각으로 스크롤되는지 확인

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
timo Ready Ready Preview, Comment Jul 16, 2026 3:18am

Request Review

@github-actions github-actions Bot requested review from jjangminii and kimminna July 15, 2026 14:10
@github-actions github-actions Bot added the ⏰ Timo-web Timo 웹 서비스 label Jul 15, 2026
@github-actions github-actions Bot added the ♥️ 혜원 혜원양 label Jul 15, 2026
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

TimeSidebar에 useRefuseEffect를 추가해 타임박스 탭이 열릴 때 현재 시각 위치로 패널을 부드럽게 스크롤하도록 변경했습니다.

Changes

타임박스 자동 스크롤

Layer / File(s) Summary
현재 시각 스크롤 효과
apps/timo-web/components/layout/sidebar/time/TimeSidebar.tsx
isOpen 상태에서 타임박스 탭이 활성화되면 현재 시각 기반 오프셋을 계산하고, 연결된 패널 컨테이너에 smooth 스크롤을 적용합니다.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: ✨ Feature

Suggested reviewers: kimminna

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed 타임박스 진입·전환·재오픈 시 현재 시각 중앙 정렬이라는 이슈의 핵심 요구를 충족합니다.
Out of Scope Changes check ✅ Passed 요구사항과 무관한 변경은 보이지 않으며, 시간 사이드바 자동 스크롤 범위에 머뭅니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed 제목이 타임박스 탭 진입 시 현재 시각으로 자동 스크롤하는 핵심 변경을 정확히 요약합니다.
Description check ✅ Passed 설명이 구현 목적, 동작 방식, 검증 항목까지 변경 내용과 잘 맞습니다.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/web/237-timebox-scroll-to-current-time

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ehye1 ehye1 changed the title feat(web): 타임박스 탭 진입 시 현재 시각으로 자동 스크롤 (#237) [FEAT] 타임박스 탭 진입 시 현재 시각으로 자동 스크롤 Jul 15, 2026
@github-actions github-actions Bot added the ✨ Feature 새로운 기능(기능성) 구현 label Jul 15, 2026
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown

Timo Performance Report

Bundle Size — timo-web
라우트 크기 First Load JS
/[locale]/home 211.48 kB 🔴 417.33 kB
/[locale]/today 195.69 kB 🔴 401.54 kB
/[locale]/focus 160.64 kB 🔴 366.50 kB
/[locale]/settings 167.19 kB 🔴 373.05 kB
/[locale]/statistics 233.45 kB 🔴 439.30 kB
/[locale]/[...rest] 0 B 🟡 205.86 kB
/[locale]/login 212.96 kB 🔴 418.82 kB
/[locale]/oauth/callback 119.66 kB 🟡 325.51 kB
/[locale]/onboarding 233.44 kB 🔴 439.30 kB
/[locale] 118.97 kB 🟡 324.83 kB
/[locale]/policy 125.09 kB 🟡 330.95 kB

공유 번들: 205.86 kB
🟢 < 200kB  |  🟡 < 350kB  |  🔴 ≥ 350kB (First Load JS · gzip)

Lighthouse — timo-web
URL Perf A11y LCP CLS TBT
/en/home 🔴 49 🟢 95 🔴 15.8s 🟢 0.000 🔴 1491ms
/en/today 🔴 63 🟢 95 🔴 15.6s 🟢 0.000 🟡 457ms
/en/focus 🔴 61 🟢 95 🔴 15.3s 🟢 0.000 🟡 534ms
/en/statistics 🔴 67 🟢 95 🔴 15.2s 🟢 0.000 🟡 290ms

Perf ≥ 70 / A11y ≥ 85 목표
LCP 🟢 < 2.5s 🟡 < 4s 🔴 ≥ 4s  |  CLS 🟢 < 0.1 🟡 < 0.25 🔴 ≥ 0.25  |  TBT 🟢 < 200ms 🟡 < 600ms 🔴 ≥ 600ms

Image Optimization — timo-web
파일 크기 포맷 상태
favicon.png 27.84 kB PNG ⚠️ 🟢
images/google-calendar.png 36.20 kB PNG ⚠️ 🟢
images/google-logo.png 26.79 kB PNG ⚠️ 🟢

총 3개 · 90.84 kB  |  🟢 < 200KB  |  🟡 < 500KB  |  🔴 ≥ 500KB
⚠️ 3개 파일 WebP/AVIF 변환 권장

측정 커밋: c983605

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/timo-web/components/layout/sidebar/time/TimeSidebar.tsx`:
- Around line 37-47: Update the timebox scrolling effect around timeboxScrollRef
to replace the 50 magic number with a named hour-height constant, and select
“auto” instead of “smooth” when the user’s prefers-reduced-motion setting is
enabled. Preserve smooth scrolling for users who have not requested reduced
motion.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2da468b4-26ae-40e4-a18c-5663466237ea

📥 Commits

Reviewing files that changed from the base of the PR and between 590c15d and ef4653c.

📒 Files selected for processing (1)
  • apps/timo-web/components/layout/sidebar/time/TimeSidebar.tsx

Comment on lines +37 to +47
useEffect(() => {
if (!isOpen || activeTab !== "timebox") return;
const container = timeboxScrollRef.current;
if (!container) return;
const now = new Date();
const offset = (now.getHours() + now.getMinutes() / 60) * 50;
container.scrollTo({
top: Math.max(0, offset - container.clientHeight / 2),
behavior: "smooth",
});
}, [activeTab, isOpen]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

매직 넘버 상수화 및 접근성(모션 줄이기) 고려

현재 시간으로 부드럽게 스크롤되는 애니메이션, 아주 매끄럽고 센스 있네요! 🌟
여기에 두 가지 정도 유지보수성과 접근성을 위한 개선을 더해보면 어떨까요?

  1. 상수화: 50이라는 값이 1시간당 높이를 의미한다면, HOUR_HEIGHT와 같은 상수로 분리해 코드의 의도를 더 명확히 해주세요.
  2. 접근성(A11y): 기기 설정에서 '모션 줄이기'를 활성화한 사용자를 위해 부드러운 스크롤 대신 즉각적인 스크롤(auto)을 사용하도록 처리하면 더 배려 깊은 UI가 됩니다.

MDN Web Docs: prefers-reduced-motion 문서도 함께 참고해 보세요!

✨ 제안하는 개선 코드
   useEffect(() => {
     if (!isOpen || activeTab !== "timebox") return;
     const container = timeboxScrollRef.current;
     if (!container) return;
+
+    const HOUR_HEIGHT = 50;
     const now = new Date();
-    const offset = (now.getHours() + now.getMinutes() / 60) * 50;
+    const offset = (now.getHours() + now.getMinutes() / 60) * HOUR_HEIGHT;
+    
+    const prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
 
     container.scrollTo({
       top: Math.max(0, offset - container.clientHeight / 2),
-      behavior: "smooth",
+      behavior: prefersReducedMotion ? "auto" : "smooth",
     });
   }, [activeTab, isOpen]);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
useEffect(() => {
if (!isOpen || activeTab !== "timebox") return;
const container = timeboxScrollRef.current;
if (!container) return;
const now = new Date();
const offset = (now.getHours() + now.getMinutes() / 60) * 50;
container.scrollTo({
top: Math.max(0, offset - container.clientHeight / 2),
behavior: "smooth",
});
}, [activeTab, isOpen]);
useEffect(() => {
if (!isOpen || activeTab !== "timebox") return;
const container = timeboxScrollRef.current;
if (!container) return;
const HOUR_HEIGHT = 50;
const now = new Date();
const offset = (now.getHours() + now.getMinutes() / 60) * HOUR_HEIGHT;
const prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
container.scrollTo({
top: Math.max(0, offset - container.clientHeight / 2),
behavior: prefersReducedMotion ? "auto" : "smooth",
});
}, [activeTab, isOpen]);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/timo-web/components/layout/sidebar/time/TimeSidebar.tsx` around lines 37
- 47, Update the timebox scrolling effect around timeboxScrollRef to replace the
50 magic number with a named hour-height constant, and select “auto” instead of
“smooth” when the user’s prefers-reduced-motion setting is enabled. Preserve
smooth scrolling for users who have not requested reduced motion.

…to feat/web/237-timebox-scroll-to-current-time

@kimminna kimminna left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

확인했습니다! 추후엔 더 부드러운 스크롤도 고려해 보면 좋을 것 같아요

@kimminna kimminna merged commit d31d18b into develop Jul 16, 2026
11 checks passed
@kimminna kimminna deleted the feat/web/237-timebox-scroll-to-current-time branch July 16, 2026 03:24
@kimminna kimminna mentioned this pull request Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature 새로운 기능(기능성) 구현 ⏰ Timo-web Timo 웹 서비스 ♥️ 혜원 혜원양

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 타임박스 탭 진입 시 현재 시각으로 자동 스크롤

2 participants