Skip to content

Pr 74 supplement#75

Merged
zmrlft merged 5 commits intomainfrom
pr-74-test
Jan 26, 2026
Merged

Pr 74 supplement#75
zmrlft merged 5 commits intomainfrom
pr-74-test

Conversation

@zmrlft
Copy link
Owner

@zmrlft zmrlft commented Jan 26, 2026

Summary by cubic

Adds cut (Ctrl+X) and undo (Ctrl+Z) to the Contribution Calendar using a new history hook, and localizes related messages. Improves editing workflow and removes hard-coded text.

  • New Features

    • Cut selection (Ctrl+X): saves buffer, clears cells, enables paste preview, shows toasts.
    • Undo (Ctrl+Z): useContributionHistory snapshots; applied to reset, fill-all-green, character preview, and import.
    • i18n: added cut/copy/no-colored-cells messages; removed hard-coded Chinese tooltips.
  • Refactors

    • Integrated history management into ContributionCalendar and added snapshot calls before edits.
    • SCSS: switched from @import to @use.
    • Dependency: updated baseline-browser-mapping to 2.9.8.

Written for commit 559c237. Summary will update on new commits.

fox142857 and others added 5 commits December 17, 2025 05:56
- Implement cut operation (Ctrl+X) for selected patterns
- Add undo capabilities (Ctrl+Z)
- Introduce useContributionHistory hook for state management
- Add a Windows batch script to start the dev environment and log the changes
- add the build_release.bat packaging script and packaging guide doc
- simplify the application build process on the windows platform
…tions

- removed hard-coded chinese tooltips and used corresponding fields from the translation file
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 5 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="frontend/src/components/ContributionCalendar.tsx">

<violation number="1" location="frontend/src/components/ContributionCalendar.tsx:927">
P2: Undo is now wired, but pen/eraser edits don't record a snapshot, so Ctrl/Cmd+Z won't revert drawing changes. Capture a history snapshot when a drawing action begins (e.g., on mouse down before the first setUserContributions) to make undo work for these edits.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

if ((e.metaKey || e.ctrlKey) && !isDrawing) {
if (e.code === 'KeyZ' && !e.shiftKey) {
e.preventDefault();
undo();
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Jan 26, 2026

Choose a reason for hiding this comment

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

P2: Undo is now wired, but pen/eraser edits don't record a snapshot, so Ctrl/Cmd+Z won't revert drawing changes. Capture a history snapshot when a drawing action begins (e.g., on mouse down before the first setUserContributions) to make undo work for these edits.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At frontend/src/components/ContributionCalendar.tsx, line 927:

<comment>Undo is now wired, but pen/eraser edits don't record a snapshot, so Ctrl/Cmd+Z won't revert drawing changes. Capture a history snapshot when a drawing action begins (e.g., on mouse down before the first setUserContributions) to make undo work for these edits.</comment>

<file context>
@@ -871,6 +920,13 @@ function ContributionCalendar({
+      if ((e.metaKey || e.ctrlKey) && !isDrawing) {
+        if (e.code === 'KeyZ' && !e.shiftKey) {
+          e.preventDefault();
+          undo();
+        }
+      }
</file context>
Fix with Cubic

@zmrlft
Copy link
Owner Author

zmrlft commented Jan 26, 2026

closes #74

@zmrlft zmrlft merged commit 4470140 into main Jan 26, 2026
5 checks passed
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.

2 participants