Skip to content

feat(focus): add focus efficiency ratio calculator - #650

Merged
TheVicky1 merged 1 commit into
TheVicky1:mainfrom
toyes3429:feat/focus-efficiency-ratio
Oct 21, 2026
Merged

TheVicky1 merged 1 commit into
TheVicky1:mainfrom
toyes3429:feat/focus-efficiency-ratio

Conversation

@toyes3429

Copy link
Copy Markdown
Contributor

1. Related Issue

Closes #574


2. Summary of Changes

  • Added a focus efficiency ratio calculator in src/lib/focus/efficiency-ratio.ts.
  • Calculates efficiency based on planned focus time and actual time spent.
  • Applies a 2-point penalty for each pause beyond the first.
  • Classifies results into optimal, adequate, under-target, and abandoned score bands.
  • Added unit tests covering efficiency calculation, pause penalties, score bands, and invalid durations.

5. Testing & Local Validation

  • npm run lint
  • npx tsc --noEmit — TypeScript check passed.
  • npm test — Full test matrix not verified.
  • npm test -- focus-efficiency-ratio — Targeted test suite passed.
  • node scratch/secret-scan.mjs
  • npm run build

Local validation performed: targeted efficiency-ratio tests passed (8 tests), and npm run typecheck completed successfully.


9. Contributor Quality Checklist

  • Micro-contribution with focused scope.
  • Single, focused feature.
  • Read and followed the PACT contributing guide.
  • No secrets or credentials intentionally included.
  • Branch verified against the latest upstream/main.
  • Commit follows Conventional Commits format.
  • Target issue linked.
  • Reviewed the implementation and test files for scope.

@toyes3429
toyes3429 requested a review from TheVicky1 as a code owner October 21, 2026 10:36
@vercel

vercel Bot commented Oct 21, 2026

Copy link
Copy Markdown

@toyes3429 is attempting to deploy a commit to the Vicky's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown

👋 Welcome to PACT OS, @toyes3429! 🚀

Thank you for taking the time to open your first pull request on PACT! We are thrilled to have you here in our open-source community.


🔍 What Happens Next?

  1. Automated Verification: Our Continuous Integration (CI) workflow is currently verifying:
    • 🔒 Zero-Secret Security Scan
    • 🔗 Markdown Link Integrity
    • 🧹 ESLint Code Quality
    • 🏷️ TypeScript Strict Typecheck
    • 🧪 56-Suite Automated Domain & Security Test Matrix
    • 🏗️ Next.js Production Build
  2. Maintainer Review: A maintainer (@TheVicky1) will review your pull request shortly.
  3. Friendly Iteration: If any adjustments or feedback are needed, we will provide clear, actionable suggestions to help get your PR merged smoothly.

📚 Helpful Quick Links

Thank you for helping make PACT better! Plan. Track. Improve. Repeat. 🏛️✨

@TheVicky1
TheVicky1 merged commit f7f916b into TheVicky1:main Oct 21, 2026
3 of 4 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.

[Analytics] Add Focus Time-Block Efficiency Ratio Calculator in src/lib/focus/efficiency-ratio.ts

2 participants