Skip to content

Codex release 1 4 0 break flow - #5

Merged
iwangjie merged 4 commits into
mainfrom
codex-release-1-4-0-break-flow
Apr 9, 2026
Merged

Codex release 1 4 0 break flow#5
iwangjie merged 4 commits into
mainfrom
codex-release-1-4-0-break-flow

Conversation

@iwangjie

@iwangjie iwangjie commented Apr 9, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

Release Notes v1.4.1

  • New Features

    • Added automatic break-skipping when idle during work intervals.
    • Added interactive skip challenge: complete a phrase-matching challenge to skip a break.
    • Enhanced countdown window with visual feedback for skip attempts.
  • Updates

    • Version bumped to 1.4.1.
    • Expanded platform-specific dependencies for improved system integration.

@coderabbitai

coderabbitai Bot commented Apr 9, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7daa953d-d816-4c36-920a-1b17549ef7d8

📥 Commits

Reviewing files that changed from the base of the PR and between c48f9d2 and 5e6b6b4.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (14)
  • Cargo.toml
  • scripts/release-preflight.sh
  • src/i18n.rs
  • src/idle.rs
  • src/linux/mod.rs
  • src/macos/state.rs
  • src/macos/timer.rs
  • src/macos/ui/countdown.rs
  • src/main.rs
  • src/skip_challenge.rs
  • src/windows/constants.rs
  • src/windows/state.rs
  • src/windows/timer.rs
  • src/windows/ui/countdown.rs

📝 Walkthrough

Walkthrough

This PR introduces a countdown skip challenge feature allowing users to skip breaks through an interactive character-input challenge. It adds cross-platform idle detection (macOS/Windows), a randomized phrase-matching mechanism, and integrates both into the break decision logic. The version is bumped to 1.4.1, and the release script is enhanced with target-specific validation.

Changes

Cohort / File(s) Summary
Versioning & Dependencies
Cargo.toml
Bumped crate version to 1.4.1 and expanded Windows features with Win32_System_SystemInformation and Win32_UI_Input_KeyboardAndMouse.
Release Tooling
scripts/release-preflight.sh
Added rustup presence check, host target detection, extra target enumeration, and per-target clippy/check validation before main build/test steps.
Internationalization
src/i18n.rs
Added five new Texts methods supporting countdown skip UI: title, progress message, and timeout/mismatch/success status strings.
Core Skip Logic
src/idle.rs, src/skip_challenge.rs
Introduced idle duration detection (macOS CGEventSource FFI, Windows GetLastInputInfo) and randomized phrase-matching challenge with feedback states (Ready/Progress/Mismatch/Timeout/Completed).
Module Declarations
src/main.rs
Added unconditional idle module and platform-gated skip_challenge module (macOS/Windows only).
Linux Integration
src/linux/mod.rs
Integrated idle skip check on work interval completion; skips break if idle time is near cycle duration, otherwise proceeds normally.
macOS Platform
src/macos/state.rs, src/macos/timer.rs, src/macos/ui/countdown.rs
Added phase start time tracking, replaced index-based phrase tracking with SkipChallenge state, captured consistent phase deadline, integrated idle skip decision on work→break transition, and rewrote countdown UI to render challenge phrase, matched progress, and feedback animation.
Windows Platform
src/windows/constants.rs, src/windows/state.rs, src/windows/timer.rs, src/windows/ui/countdown.rs
Added feedback timer ID constant, added phase start time and SkipChallenge state tracking, captured consistent phase deadline, integrated idle skip decision on work→break transition, and redesigned countdown window to render challenge phrase with visual feedback and shake animation on mismatch/timeout.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI as Countdown UI
    participant Challenge as SkipChallenge
    participant Idle as Idle Detector
    participant Core as Timer/State

    rect rgba(100, 150, 200, 0.5)
    note over User,Core: Work Phase Completion → Break Decision
    Core->>Idle: should_skip_break(elapsed)
    Idle-->>Core: bool (check idle duration)
    
    alt Idle time near work duration
        Core->>Core: Stay in Working phase
        Core-->>UI: No countdown shown
    else User still active
        Core->>UI: Show countdown window
        Core->>Challenge: Create random SkipChallenge
        Challenge-->>UI: Initial snapshot (phrase, 0/N matched)
        UI-->>User: Display phrase challenge
    end
    end

    rect rgba(150, 180, 100, 0.5)
    note over User,Challenge: Skip Challenge Input Flow
    User->>UI: Type character
    UI->>Challenge: register_char(ch, now)
    
    alt Character matches next expected
        Challenge-->>UI: Progress snapshot (matched++)
        UI-->>User: Highlight matched portion
    else Character mismatch or timeout
        Challenge-->>UI: Mismatch/Timeout snapshot (reset)
        UI-->>User: Flash red + shake animation
    else Full phrase matched
        Challenge-->>UI: Completed snapshot
        UI->>Core: skip_break_requested = true
        Core->>Core: Skip break, reset work timer
        Core-->>User: Confirm skip message
    end
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • feat: Windows UI Support #4: Updates Windows-specific Cargo.toml features and modifies src/windows modules (constants, state, timer, ui/countdown) to support platform-level integration of the skip challenge feature.
  • refacor: 工程化 & 扩展性 #1: Modifies the same macOS modules (src/main.rs, src/macos/state.rs, src/macos/timer.rs, src/macos/ui/countdown.rs) that implement macOS-specific skip challenge and idle detection behavior.

Poem

🐰 Hop, hop, the breaks do skip,
When idle time slips through the trip,
Type the phrase, match every letter,
Shake and flash make chances better,
Rest awaits or work repeats—
Challenge gardens where they meet! 🌳✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex-release-1-4-0-break-flow

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 and usage tips.

@iwangjie
iwangjie merged commit fd3cf0c into main Apr 9, 2026
17 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.

1 participant