Skip to content

Refactoringç#22

Merged
apzuk3 merged 11 commits intomainfrom
refactoringç
Mar 20, 2026

Hidden character warning

The head ref may contain hidden characters: "refactoring\u00e7"
Merged

Refactoringç#22
apzuk3 merged 11 commits intomainfrom
refactoringç

Conversation

@apzuk3
Copy link
Copy Markdown
Contributor

@apzuk3 apzuk3 commented Mar 20, 2026

No description provided.

apzuk3 added 11 commits March 12, 2026 14:01
- Replace UsageUpdates channel with callback-based subscription
- Support multiple subscribers for protection pause/resume events
- Add OnUsageUpdated, OnLLMDailySummaryReady, OnProtectionPause, and OnProtectionResumed methods
- Update main.go to use new event subscription pattern
- Relocate config/log directory to ~/.focusd
- Migrated GenAI client initialization to usage service
- Implemented subscriber pattern for protection and usage events
- Added specialized Slack classifier and application prompt templates
- Introduced internal/settings package for centralized configuration
- Updated main.go to use refactored services and settings
- Renamed classifier_llm_slack.go to classifier_llm_custom.go
- Simplified classifySlackActivity by inlining instructions and removing redundant normalization
- Cleaned up unused imports
- Moved all inline LLM prompts for websites and apps to .txt asset files
- Implemented  and asset embedding infrastructure
- Introduced  for safety overrides on sensitive pages
- Refactored  and  to use asset-based prompts
- Added tests for critical page classifier
…rness

- Refactored service_usage_test.go to use a new test harness.
- Simplified usageDriver logic by removing it and using direct DB access in tests.
- Updated utils.go with parseURLNormalized for better URL handling.
- Refined ServiceUsage and usageSession logic.
- Added harness_test.go for shared test setup.
…ation modes

- Modified Whitelist and CalculateTerminationMode to globally allow whitelisted hostnames across all browsers.
- Removed TerminationModePaused, using TerminationModeAllow with TerminationModeSourcePaused instead.
- Fixed pagination assertions in insights_basic_test.go.
- Expanded protection tests in service_usage_test.go and added test harness helpers.
- Fixed nil pointer panic in Whitelist by checking if parseURLNormalized returns a valid result.
- Added fallback hostname parsing for strings that are not full URLs (e.g., example.com).
- Restored strings import in protection.go.
- Fixed slice out-of-bounds panic in TestGetUsageList_TerminationModeFilter.
- Updated TitleChanged to return ApplicationUsage and handle active pauses/whitelists correctly.\n- Added ManualResume event and method to Protection.\n- Updated test harness to support new assertions.\n- Added explicit native blocking calls for apps and URLs in main.go.\n- Added logging for blocking.\n- Fixed OnUsageUpdated to handle pointers correctly in both backend and frontend.
- Removed AppBlocker callback mechanism from usage.Service.\n- Simplified usage.NewService in main.go and tests.\n- Cleaned up usageHarness and tests by removing blocker event assertions.\n- Updated usage:update event registration to use pointer type.
@apzuk3 apzuk3 had a problem deploying to Production release March 20, 2026 13:50 — with GitHub Actions Failure
@apzuk3 apzuk3 merged commit b3e7c0d into main Mar 20, 2026
1 check failed
@apzuk3 apzuk3 deleted the refactoringç branch March 20, 2026 13:50
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