Conversation
There was a problem hiding this comment.
4 issues found across 12 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="frontend/src/components/ContributionCalendar.module.scss">
<violation number="1" location="frontend/src/components/ContributionCalendar.module.scss:44">
P2: The first weekday label loses its intended row alignment because `.week` no longer sets a base `grid-row`.</violation>
</file>
<file name="README_zh.md">
<violation number="1" location="README_zh.md:99">
P2: The documented Go version is outdated. The project’s `go.mod` requires Go 1.24.0, so `Go 1.23+` can mislead contributors into using an incompatible toolchain.</violation>
</file>
<file name="frontend/src/hooks/useContributionEditor.ts">
<violation number="1" location="frontend/src/hooks/useContributionEditor.ts:149">
P2: Mixing UTC-parsed dates (`new Date(dateStr)`) with local-time dates (`new Date(year, 0, 1)`) causes incorrect grid coordinates for users in non-UTC timezones. Use a consistent time basis — either parse both as UTC or both as local time. For example, split the date string and construct via `new Date(y, m-1, d)` to stay in local time consistently.</violation>
<violation number="2" location="frontend/src/hooks/useContributionEditor.ts:665">
P1: Drawing actions are not undoable because `pushSnapshot()` is never called before `applyDrawAction`. Every other mutation path in this hook snapshots the state first. Add a `pushSnapshot()` call in `handleTileMouseDown` when drawing begins so the pre-draw state is captured for undo.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| return; | ||
| } | ||
|
|
||
| setIsDrawing(true); |
There was a problem hiding this comment.
P1: Drawing actions are not undoable because pushSnapshot() is never called before applyDrawAction. Every other mutation path in this hook snapshots the state first. Add a pushSnapshot() call in handleTileMouseDown when drawing begins so the pre-draw state is captured for undo.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At frontend/src/hooks/useContributionEditor.ts, line 665:
<comment>Drawing actions are not undoable because `pushSnapshot()` is never called before `applyDrawAction`. Every other mutation path in this hook snapshots the state first. Add a `pushSnapshot()` call in `handleTileMouseDown` when drawing begins so the pre-draw state is captured for undo.</comment>
<file context>
@@ -0,0 +1,903 @@
+ return;
+ }
+
+ setIsDrawing(true);
+ setLastHoveredDate(dateStr);
+ applyDrawAction(dateStr, drawMode);
</file context>
| const getDateCoord = React.useCallback( | ||
| (dateStr: string) => { | ||
| const date = new Date(dateStr); | ||
| const yearStart = new Date(year, 0, 1); |
There was a problem hiding this comment.
P2: Mixing UTC-parsed dates (new Date(dateStr)) with local-time dates (new Date(year, 0, 1)) causes incorrect grid coordinates for users in non-UTC timezones. Use a consistent time basis — either parse both as UTC or both as local time. For example, split the date string and construct via new Date(y, m-1, d) to stay in local time consistently.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At frontend/src/hooks/useContributionEditor.ts, line 149:
<comment>Mixing UTC-parsed dates (`new Date(dateStr)`) with local-time dates (`new Date(year, 0, 1)`) causes incorrect grid coordinates for users in non-UTC timezones. Use a consistent time basis — either parse both as UTC or both as local time. For example, split the date string and construct via `new Date(y, m-1, d)` to stay in local time consistently.</comment>
<file context>
@@ -0,0 +1,903 @@
+ const getDateCoord = React.useCallback(
+ (dateStr: string) => {
+ const date = new Date(dateStr);
+ const yearStart = new Date(year, 0, 1);
+ const firstDayOfWeek = yearStart.getDay();
+ const daysSinceYearStart = Math.floor(
</file context>
Summary by cubic
Refactored the contribution editor and calendar into a cleaner, faster UI with a new
useContributionEditorhook, streamlined layout/styles, and lighter global defaults. Updated docs and added date utilities; upgraded desktop runtime dependencies.Refactors
useContributionEditor(drawing modes, pen intensity, buffer, import/export).ContributionCalendarand SCSS; consistent grid sizing, smoother rendering, and disabled text selection.utils/date.tsfor ISO date parse/format helpers used by the editor.App.tsximports and helpers trimmed; naming and minor logic cleanups.ImageImportCardeffect deps fixed; removed an unused prop.Dependencies
github.com/wailsapp/wails/v2tov2.11.0.github.com/wailsapp/go-webview2tov1.0.22.Written for commit 2be2764. Summary will update on new commits.