v2.8.0: 도전과제 시스템 + 다크 디자인 리뉴얼 + 안정성 강화

Added — 도전과제 시스템 (153개 자동 평가)
- core/achievements.py: 16개 카테고리, 5단계 등급, 시크릿 9개, 메타 도전과제
- ui/achievements_view.py: 4탭 다이얼로그 (전체/진행중/완료/시크릿)
- 5분 throttle 자동 평가 + 시스템 알림 + Discord embed push
- achievements 테이블 확장 (code/category/tier/is_secret/progress/target)
- hire_date 자동 추적, 뷰 진입 카운터 8개 settings 키

Changed — 다크 테마 디자인 리뉴얼
- ui/dark_components.py: 재사용 가능한 다크 컴포넌트 (header/card/button/progress)
- 통계/도움말/도전과제 다이얼로그 일관 다크 톤
- matplotlib 차트 다크 테마 적용 (figure/axes/grid/legend)
- 등급별 카드 그라디언트 (브론즈/실버/골드/플래티넘/레전드)

Fixed — 안정성·일관성
- 타임존 자정 경계 버그 (has_notification_today UTC vs localtime mismatch)
- DB 연결 누수: _conn() 컨텍스트 매니저 도입, 40+ 메서드 변환
- DB 이중 부트스트랩 제거 (MainWindow(db=None) 옵션 인자)
- crash_handler 다단계 폴백 (DB → 파일 → stderr)
- updater PID race: 지수 backoff 재시도 (총 ~9초)
- Discord URL 형식 검증 (snowflake regex)
- 일일 보고서 저녁 섹션, MealTimeDialog 출/퇴근 범위 검증
- check_dinner_reminder 신규, 알림 임계값 5개 설정화
- closeEvent timer/notifier 정리 (aboutToQuit hook)
- 마이그레이션 12개 모두 _conn() + try/finally
- DB 인덱스 5개 추가 (break/overtime/leave date)

Tests
- pytest 116/116 PASS, 통합 시나리오 48/48 PASS

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
68893236+KINDNICK@users.noreply.github.com
2026-05-01 01:11:13 +09:00
co-authored by Claude Opus 4.7
parent ff71886fd7
commit c5df37ca57
28 changed files with 4247 additions and 1313 deletions
+5 -5
View File
@@ -39,7 +39,7 @@ class TestSendNetwork:
resp.__exit__.return_value = False
mock_urlopen.return_value = resp
ok = send('https://discord.com/api/webhooks/123/abc', 'title', 'desc')
ok = send('https://discord.com/api/webhooks/123456789012345678/' + 'a' * 60, 'title', 'desc')
assert ok is True
# User-Agent 헤더가 브라우저로 위장되어 있는지 (Cloudflare 우회)
@@ -55,18 +55,18 @@ class TestSendNetwork:
resp.__exit__.return_value = False
mock_urlopen.return_value = resp
assert send('https://discord.com/api/webhooks/x', 't', 'd') is False
assert send('https://discord.com/api/webhooks/123456789012345678/' + 'b' * 60, 't', 'd') is False
@patch('utils.discord_webhook.urllib.request.urlopen')
def test_network_error_returns_false(self, mock_urlopen):
import urllib.error
mock_urlopen.side_effect = urllib.error.URLError('boom')
assert send('https://discord.com/api/webhooks/x', 't', 'd') is False
assert send('https://discord.com/api/webhooks/123456789012345678/' + 'b' * 60, 't', 'd') is False
@patch('utils.discord_webhook.urllib.request.urlopen')
def test_timeout_returns_false(self, mock_urlopen):
mock_urlopen.side_effect = TimeoutError('slow')
assert send('https://discord.com/api/webhooks/x', 't', 'd') is False
assert send('https://discord.com/api/webhooks/123456789012345678/' + 'b' * 60, 't', 'd') is False
class TestPayloadShape:
@@ -79,7 +79,7 @@ class TestPayloadShape:
resp.__exit__.return_value = False
mock_urlopen.return_value = resp
send('https://discord.com/api/webhooks/x', 'TITLE', 'DESC',
send('https://discord.com/api/webhooks/123456789012345678/' + 'b' * 60, 'TITLE', 'DESC',
color=COLOR_GREEN, fields=[{"name": "f", "value": "v"}])
req = mock_urlopen.call_args[0][0]
body = _json.loads(req.data.decode('utf-8'))