Skip to content

Conversation

@ReenigneArcher
Copy link
Member

@ReenigneArcher ReenigneArcher commented Dec 25, 2025

Description

This PR adds screenshots to tests. The goal is to be able to easily review what the tray icon looks like in different states.

TODO:

  • fix sonar warnings
  • post images in PR comment and/or github step summary
    • secondary workflow to:
      • download artifacts from first job
      • publish images to a screenshot branch
      • comment on PR
        • compare master branch images to PR images, make obvious if images are mismatched (need to remove date/time for reliable comparison)
  • capture more states/events of tray
  • minimize all windows before tests (on windows)
  • improve test coverage
  • misc issues
    • show menu
      • windows
      • linux
      • macos
    • ensure notifications appear
      • Linux
      • macOS
        • fix permissions on macOS runner?
      • Windows
        • disabled do not disturb
        • disabled quiet time (1st hour after initial setup) by adjusting system time
        • works locally, but not in GitHub runner?
    • tests hanging on macOS
    • multiple tray icons appearing on macOS, not properly cleaned up between tests
    • libappindicator version is not building (probably due to dependencies added by new virtual display action)
    • merge (feat(actions): add setup_virtual_desktop action actions#103) and release virtual display action
    • show menu in more states, like checked / unchecked checkboxes and whatnot

Screenshot

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

@codecov
Copy link

codecov bot commented Dec 25, 2025

Codecov Report

❌ Patch coverage is 80.00000% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.25%. Comparing base (09c5784) to head (2b9cd61).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/tray_linux.c 76.74% 5 Missing and 5 partials ⚠️
src/tray_darwin.m 81.48% 3 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master      #86       +/-   ##
===========================================
+ Coverage   62.01%   74.25%   +12.23%     
===========================================
  Files           4        4               
  Lines         337      404       +67     
  Branches       63       77       +14     
===========================================
+ Hits          209      300       +91     
+ Misses         92       65       -27     
- Partials       36       39        +3     
Flag Coverage Δ
Linux 60.54% <76.74%> (+11.48%) ⬆️
Windows 72.86% <100.00%> (+16.16%) ⬆️
libappindicator3-dev 60.54% <76.74%> (+11.48%) ⬆️
libayatana-appindicator3-dev 60.54% <76.74%> (?)
macOS 63.46% <81.48%> (+6.83%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/tray_windows.c 82.38% <100.00%> (+18.05%) ⬆️
src/tray_darwin.m 85.71% <81.48%> (+1.78%) ⬆️
src/tray_linux.c 71.77% <76.74%> (+9.12%) ⬆️

@ReenigneArcher ReenigneArcher force-pushed the test/add-screenshots branch 29 times, most recently from d361a0c to c6d4b9b Compare December 31, 2025 05:00
@ReenigneArcher ReenigneArcher force-pushed the test/add-screenshots branch 7 times, most recently from a14e0a8 to 5d082c1 Compare January 8, 2026 04:44
@ReenigneArcher ReenigneArcher force-pushed the test/add-screenshots branch 5 times, most recently from d7ae591 to bcc76cf Compare January 8, 2026 23:01
Adds logic to create an invisible toplevel window as an anchor for the tray menu, ensuring compatibility with AppIndicator and headless environments. Uses modern GTK API when available and falls back to legacy methods as needed.
Tray items on macOS now display a tooltip if the 'tooltip' field is set. This improves user experience by providing additional context when hovering over the tray icon.
Eliminated unnecessary tray_loop(1) calls in unit tests for tooltip, checkbox, and icon updates. WaitForTrayReady is sufficient for synchronization, simplifying the test logic.
Updated tray_exit to remove the status item from the status bar using dispatch_async on the main thread, ensuring thread safety for NSStatusBar operations.
Replaces or removes calls to tray_loop(1) in unit tests to prevent hanging during test execution. The TestTrayLoop now uses tray_loop(0) for non-blocking behavior, and other tests no longer invoke tray_loop, improving test reliability and speed.
Updated tray_exit to check if the current thread is the main thread before removing the status item. If not on the main thread, the removal is dispatched synchronously to the main thread to ensure thread safety.
Enhanced the WaitForTrayReady method to handle macOS (AppKit) by adding a delay, ensuring the tray icon appears before screenshots. Updated comments for clarity and maintained Linux (AppIndicator) event processing.
@ReenigneArcher ReenigneArcher force-pushed the test/add-screenshots branch 3 times, most recently from 7677502 to d86ae2f Compare January 9, 2026 04:02
Introduces a step to grant screen recording permissions on macOS runners by modifying the TCC database, preventing popup dialogs during CI runs. This ensures smoother automated workflows and addresses issues with screen capture access in GitHub Actions.
Introduces an appindicator_type variable to the CI matrix for distinguishing between 'ayatana' and 'legacy' appindicator packages. Passes this variable to the setup_virtual_desktop action to allow for more flexible environment configuration.
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
36 New issues
1 Security Hotspot
36 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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