-
-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System tray state machine #290
base: main
Are you sure you want to change the base?
Conversation
Thanks for kicking this off @jesicasusanto ! Let's use .svg where possible 🙏 |
|
openadapt/widget/app.py
Outdated
) | ||
|
||
def position_above_active_window(self, *args): | ||
if sys.platform == "win32": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jesicasusanto ! What do you think about re-using openadapt.window
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
openadapt/widget/app.py
Outdated
self.window.size = (50, 50) | ||
self.window.clearcolor = (255, 255, 255) | ||
self.window.always_on_top = True | ||
self.PROC = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this isn't a constant, what do you think about naming it e.g. process
? Even better, how about splitting it into replay_process
and record_process
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved in ecf0e65
openadapt/widget/app.py
Outdated
active_window_properties["rectangle"].right, | ||
) | ||
except: | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned elsewhere I think it would be preferable to re-use openadapt.window
here.
In general, however, swallowing exceptions like this is not recommended -- logging is preferable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved in 6096a8f
Update :
|
To Do :
|
@jesicasusanto @0dm I think we want to replace this and #300 as described in #300 (comment) |
Let's replace the floating widget with a system tray icon |
Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information |
1 similar comment
Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information |
openadapt/strategies/stateful.py
Outdated
active_window_dict["state"].pop("data") | ||
if reference_window_dict and "state" in reference_window_dict: | ||
reference_window_dict["state"].pop("data") | ||
if active_window_dict and "state" in active_window_dict : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please format with black
🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in 1027546
openadapt/strategies/stateful.py
Outdated
if first_window_id != last_window_id: | ||
logger.warning(f"{first_window_id=} != {last_window_id=}") | ||
ignore_window_ids.add(first_window_id) | ||
ignore_window_ids.add(last_window_id) | ||
logger.info(f"ignoring {first_window_title=} {last_window_title=}") | ||
window_event_states = [ | ||
action_event.window_event.state | ||
if action_event.window_event.state["window_id"] not in ignore_window_ids | ||
if action_event.window_event.state is not None and action_event.window_event.state["window_id"] not in ignore_window_ids |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove is not None
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in 49d3d32
openadapt/window/_windows.py
Outdated
@@ -8,7 +8,7 @@ | |||
import pickle | |||
|
|||
|
|||
def get_active_window_state() -> dict: | |||
def get_active_window_state(show_data) -> dict: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about:
def get_active_window_state(metadata_only=False) -> dict:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As addressed in bb45d40, after deciding to implement the tray state machine, we no longer require any type of flag on the get_active_window_state function. Previously, the flag was utilized to expedite obtaining the active window state, as it was necessary for positioning the widget above the active window.
pyproject.toml
Outdated
@@ -43,6 +43,7 @@ ascii_magic = "2.3.0" | |||
dictalchemy3 = "1.0.0" | |||
fire = "0.4.0" | |||
ipdb = "0.13.11" | |||
kivy = "2.2.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove if unused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in 3a66d88
@jesicasusanto please fix merge conflicts 🙏 |
What kind of change does this PR introduce?
This PR resolves #224. This PR introduces a new feature to create a window that is always on top and allows customization of its styling. It updates the position of the window to be at the top right of the active window the user is interacting with. The contents of the window are dynamically updated to show different icons based on the active window and available recordings.
Summary
The motivation for making this change is to enhance the demo for the calculator sequence, making it smoother and providing indicator status for the recordings. This improvement aligns with the open issue #236 .
Checklist
How can your code be run and tested?