Skip to content
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

add unhealthy icon reminder #665

Merged
merged 4 commits into from
Dec 3, 2024
Merged

add unhealthy icon reminder #665

merged 4 commits into from
Dec 3, 2024

Conversation

ToSeven
Copy link
Contributor

@ToSeven ToSeven commented Nov 11, 2024

/claim #471

Copy link

vercel bot commented Nov 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
screenpipe ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 3, 2024 4:12pm

@algora-pbc algora-pbc bot mentioned this pull request Nov 11, 2024
Copy link

algora-pbc bot commented Nov 11, 2024

💵 To receive payouts, sign up on Algora, link your Github account and connect with Stripe.

@ToSeven
Copy link
Contributor Author

ToSeven commented Nov 11, 2024

The icon will be marked as failed when the screenpipe status is unhealthy. The failed icon is "screenpipe-app-tauri/src-tauri/icons/screenpipe-logo-tray-failed.png" @louis030195

@@ -45,6 +46,18 @@ export function useHealthCheck() {
throw new Error(`http error! status: ${response.status}`);
}
const data: HealthCheckResponse = await response.json();
console.log(data);
if(data.status=="unhealthy"){
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you use linter

pub fn set_tray_health_icon(app_handle: tauri::AppHandle<tauri::Wry>) {

if let Some(main_tray) = app_handle.tray_by_id("screenpipe_main") {
let _ =main_tray.set_icon(Some(tauri::image::Image::from_path("icons/screenpipe-logo-tray-black.png").unwrap()));
Copy link
Collaborator

Choose a reason for hiding this comment

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

same, use linter

@louis030195
Copy link
Collaborator

@ToSeven nice!

any way you can make the icon looks like something is broken?

this does not indicate it currently

Screenshot 2024-11-11 at 8 35 20 AM

@ToSeven
Copy link
Contributor Author

ToSeven commented Nov 14, 2024

@ToSeven nice!

any way you can make the icon looks like something is broken?

this does not indicate it currently

Screenshot 2024-11-11 at 8 35 20 AM

how about this icon? @louis030195
image

@louis030195
Copy link
Collaborator

@ToSeven nice!
any way you can make the icon looks like something is broken?
this does not indicate it currently
Screenshot 2024-11-11 at 8 35 20 AM

how about this icon? @louis030195 image

yeah this is good!

@ToSeven
Copy link
Contributor Author

ToSeven commented Nov 18, 2024

3eea5e2
I have changed my code according to what you advised. @louis030195

@louis030195
Copy link
Collaborator

Screenshot 2024-11-18 at 9 32 21 AM

how to test? atm icon does not change

@ToSeven
Copy link
Contributor Author

ToSeven commented Nov 20, 2024

Screenshot 2024-11-18 at 9 32 21 AM how to test? atm icon does not change

The icon will be in failed status when you kill the screenpipe backend process. Actually, the icon will change as soon as the health check is deemed unhealthy. @louis030195

@louis030195
Copy link
Collaborator

@ToSeven this did not work, backend was down but it was showing the update icon for some reason (bun tauri dev)

@ToSeven
Copy link
Contributor Author

ToSeven commented Nov 26, 2024

@ToSeven this did not work, backend was down but it was showing the update icon for some reason (bun tauri dev)

I cannot successfully compile Screenpipe on Windows. I tested this feature when I committed this PR, and it worked well. I am waiting for a stable version to figure out the true reason. @louis030195

@louis030195
Copy link
Collaborator

louis030195 commented Dec 3, 2024

@ToSeven tested again and indeed it works

are you on windows?

i noticed on windows the background is sometimes black and sometimes white so need to handle this (maybe)

but on macos it's always black background so icon border hsould be white

any chance you can at least make icon white for macos? i added $50 to the bounty

then we can merge

@ToSeven
Copy link
Contributor Author

ToSeven commented Dec 3, 2024

@ToSeven tested again and indeed it works

are you on windows?

i noticed on windows the background is sometimes black and sometimes white so need to handle this (maybe)

but on macos it's always black background so icon border hsould be white

any chance you can at least make icon white for macos? i added $50 to the bounty

then we can merge

Okay, I will commit a new PR.

@louis030195
Copy link
Collaborator

/approve

@ToSeven okay merging, can you send pr for the white one plz? can do macos only for the white icon border if you want (no idea how to detect the color of windows)

Copy link

algora-pbc bot commented Dec 3, 2024

@louis030195: The claim has been successfully added to reward-all. You can visit your dashboard to complete the payment.

@louis030195 louis030195 merged commit 99cbaa5 into mediar-ai:main Dec 3, 2024
2 of 6 checks passed
@louis030195
Copy link
Collaborator

app crashes now :(

only happens in bun tauri build

@louis030195
Copy link
Collaborator

      // if (data.status == "unhealthy") {
      //   try {
      //     await invoke("set_tray_unhealth_icon");
      //   } catch (error) {
      //     console.error("set unhealthy icon:", error);
      //   }
      // } else {
      //   await invoke("set_tray_health_icon");
      //   console.log("set healthy icon:");
      // }

this fix the crash..

@louis030195
Copy link
Collaborator

app is down

@ToSeven
Copy link
Contributor Author

ToSeven commented Dec 4, 2024

      // if (data.status == "unhealthy") {
      //   try {
      //     await invoke("set_tray_unhealth_icon");
      //   } catch (error) {
      //     console.error("set unhealthy icon:", error);
      //   }
      // } else {
      //   await invoke("set_tray_health_icon");
      //   console.log("set healthy icon:");
      // }

this fix the crash..

Today I test this code on Windows, and it works well. Did this error happen on the Mac platform?

@ToSeven
Copy link
Contributor Author

ToSeven commented Dec 4, 2024

@ToSeven tested again and indeed it works

are you on windows?

i noticed on windows the background is sometimes black and sometimes white so need to handle this (maybe)

but on macos it's always black background so icon border hsould be white

any chance you can at least make icon white for macos? i added $50 to the bounty

then we can merge

I am on windows, and I do not notice your situation. (> i noticed on windows the background is sometimes black and sometimes white so need to handle this (maybe) @louis030195
image
image

@louis030195
Copy link
Collaborator

yes its macos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants