Skip to content

Add discipline mode#5

Merged
Kanscape merged 1 commit into
mainfrom
discipline-mode
Jun 28, 2026
Merged

Add discipline mode#5
Kanscape merged 1 commit into
mainfrom
discipline-mode

Conversation

@Kanscape

@Kanscape Kanscape commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add discipline mode with weekly, custom cycle, and one-time lock options.
  • Gate app content during active locks and show a dedicated discipline mode screen.
  • Add the home entry button and set the iOS home top scroll edge effect to soft while leaving macOS unchanged.

@Kanscape Kanscape marked this pull request as ready for review June 28, 2026 08:44
@Kanscape Kanscape added the enhancement New feature or request label Jun 28, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9af7820bd6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}

public var totalSeconds: TimeInterval {
TimeInterval(max(0, days) * 24 * 60 * 60 + max(0, hours) * 60 * 60 + max(0, minutes) * 60)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Split totalSeconds arithmetic so the package compiles

With Swift 6.2.4, the new package fails during swift test at this expression because the type checker cannot solve the chained max/multiplication expression, so neither the DisciplineModeCore tests nor any build that compiles this file can complete. Break the day/hour/minute totals into typed intermediate values before converting to TimeInterval.

Useful? React with 👍 / 👎.

Comment on lines +82 to +85
Button {
isPresented.wrappedValue = true
} label: {
Label("预告", systemImage: "calendar")
Label("自律模式", systemImage: "calendar.badge.lock")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the preview month toolbar entry

On the mobile home screen, replacing the existing NavigationLink to PreviewMonthScreen() with this button removes the only repo reference that presents the preview month table (rg "PreviewMonthScreen" Hana now only finds the screen's definition), so iOS/visionOS users can no longer reach that feature. Keep the existing preview action or add another entry point when adding discipline mode.

Useful? React with 👍 / 👎.

@Kanscape Kanscape merged commit 67b13b1 into main Jun 28, 2026
2 checks passed
@Kanscape Kanscape deleted the discipline-mode branch June 28, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant