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

[positioner] handleIconState in JS #1822

Merged
merged 8 commits into from
Oct 1, 2024
Merged

[positioner] handleIconState in JS #1822

merged 8 commits into from
Oct 1, 2024

Conversation

jbolda
Copy link
Member

@jbolda jbolda commented Sep 21, 2024

Motivation

We need to handle events to update the icon state in this plugin. Previously, we could only do this in Rust, which meant it was not possible create the TrayIcon in JS with an action. This adds a function to handle the same.

@jbolda jbolda requested a review from a team as a code owner September 21, 2024 05:06
Copy link
Contributor

github-actions bot commented Sep 21, 2024

Package Changes Through ad3e1c6

There are 8 changes which include cli with prerelease, deep-link with prerelease, dialog with prerelease, sql with prerelease, fs with prerelease, positioner with prerelease, positioner-js with prerelease, updater with prerelease

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
api-example 2.0.0-rc.7 2.0.0-rc.8
cli 2.0.0-rc.1 2.0.0-rc.2
deep-link 2.0.0-rc.6 2.0.0-rc.7
fs 2.0.0-rc.5 2.0.0-rc.6
dialog 2.0.0-rc.7 2.0.0-rc.8
http 2.0.0-rc.5 2.0.0-rc.6
persisted-scope 2.0.0-rc.5 2.0.0-rc.6
positioner 2.0.0-rc.1 2.0.0-rc.2
positioner-js 2.0.0-rc.1 2.0.0-rc.2
single-instance 2.0.0-rc.4 2.0.0-rc.5
sql 2.0.0-rc.2 2.0.0-rc.3
updater 2.0.0-rc.3 2.0.0-rc.4

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@jbolda
Copy link
Member Author

jbolda commented Sep 22, 2024

I think our types might be wrong here.
image

@amrbashir
Copy link
Member

@jbolda that is indeed the case, the Rust type is actually an enum:

enum Position {
  Physical { .. },
  Logical { .. },
}

and it will be serialized into

{
  "Physical or Logical": { .. }
}

So we need to at runtime, convert these values into the JS PhysicalPosition class

lucasfernog added a commit to tauri-apps/tauri that referenced this pull request Sep 24, 2024
#11104)

* fix(api): convert `Position` to `PhsyicalPosition` for `TrayIconEvent`

ref: tauri-apps/plugins-workspace#1822 (comment)

* fix lint

* Add missing `doubleClick` event type

* change file

* update lockfile

* Update .changes/api-tray-icon-event-value-mismatch-type.md [skip ci]

---------

Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
@lucasfernog lucasfernog merged commit 2f7e32b into v2 Oct 1, 2024
24 checks passed
@lucasfernog lucasfernog deleted the handle-icon-state branch October 1, 2024 13:15
amrbashir added a commit that referenced this pull request Oct 2, 2024
lucasfernog pushed a commit that referenced this pull request Oct 2, 2024
* fix(positioner): pass correct values through IPC

followup to #1822

* build api & remove packageManager field
gezihuzi pushed a commit to Hypobenthos/plugins-workspace that referenced this pull request Oct 3, 2024
* [positioner] handleIconState in JS

* update readme

* fix change file version

* fixes

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
gezihuzi pushed a commit to Hypobenthos/plugins-workspace that referenced this pull request Oct 3, 2024
* fix(positioner): pass correct values through IPC

followup to tauri-apps#1822

* build api & remove packageManager field
@jbolda
Copy link
Member Author

jbolda commented Oct 7, 2024

@amrbashir
Copy link
Member

@jbolda fixed in #1858

Sir-Thom pushed a commit to Sir-Thom/plugins-workspace that referenced this pull request Oct 22, 2024
* [positioner] handleIconState in JS

* update readme

* fix change file version

* fixes

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
Sir-Thom pushed a commit to Sir-Thom/plugins-workspace that referenced this pull request Oct 22, 2024
* fix(positioner): pass correct values through IPC

followup to tauri-apps#1822

* build api & remove packageManager field
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.

3 participants