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

Introduce Side Pane Attributes #9

Merged
merged 1 commit into from
Jan 10, 2024

Conversation

fscarponi
Copy link
Contributor

@fscarponi fscarponi commented Dec 19, 2023

From PKGS 1104
This commit adds InfoPanelContent Attributes for "Declared" type to the asPanelContent function, including the tab's title, variant's title, and attributes.

A click event handler for the selected packages is also added to refresh the side panel content.
A new event for package selection has been placed in 'PackageListItemEvent'.

Furthermore, the attribute type name description and content title in the package search UI have been updated for clarity. The style of the 'Search' content in HeaderAttributesTab has also been modified to reduce redundancy and clarify display conditions. Now, by clicking on an attribute badge, it's possible to scroll to individual attributes with a smooth animation.

To Do:

  • number of platform badges in the header attributes (blocked by Jewel, waiting the merge of related PR)
  • fix algorithm for source sets gathering
image image image

@fscarponi fscarponi force-pushed the fabrizio.scarponi/PKGS-1104-Platform-panel branch from 9bdbb0f to 4aee879 Compare December 19, 2023 14:34
@fscarponi fscarponi requested a review from lamba92 December 19, 2023 14:48
@fscarponi fscarponi force-pushed the fabrizio.scarponi/PKGS-1104-Platform-panel branch from 4aee879 to 0b31120 Compare December 19, 2023 15:50
onClick = {
//this event should be handled when you click on a selected package to refresh side panel content
if (isSelected ) onPackageListItemEvent(
PackageListItemEvent.InfoPanelEvent.OnSelectedPackageClick(content.id)
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the behaviour here? Afair changing the selection is handled by the SelectableLazyColumn callback for selection change. Why do we need to add an onClick here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

1 - select package X (the side panel shows the package details) -> onSelectionChange() does the job
2 - click on a header badge (side pane shows the platforms) -> onClick for badge does the job
3 - click again on package X (the side panel shows the header's platform details) -> onSelectionChange() has not been called cause the selection is not changed

possible solutions:
-> make headers selectable -> is not what we want (will not fix anyway the multiSelection Interaction)
-> handle this corner case -> when someone clicks on already selected package, set the correct content on the side panel

@lamba92
Copy link
Collaborator

lamba92 commented Dec 21, 2023

Also, you need to update to the latest submodule of api-models.

@fscarponi fscarponi requested a review from lamba92 December 22, 2023 09:37
@fscarponi fscarponi force-pushed the fabrizio.scarponi/PKGS-1104-Platform-panel branch 2 times, most recently from 5f9bad1 to ebb58df Compare January 10, 2024 12:48
…esTab

Refactor platformListMock to getter in HeaderAttributesTab
scrollToAttribute has CoroutineScope as receiver
rename InfoPanelContentEvent Attributes Declared into FromVariant and Search into FromSearch
rename Attributes Declared into FromVariant and Search into FromSearch

This commit adds InfoPanelContent Attributes for "Declared" type to the asPanelContent function, including the tab's title, variant's title, and attributes. A click event handler for the selected packages is also added to refresh the side panel content. A new event for package selection has been placed in 'PackageListItemEvent'. Furthermore, the attribute type name description and content title in the package search UI have been updated for clarity. The style of the 'Search' content in HeaderAttributesTab has also been modified to reduce redundancy and clarify display conditions. Now, by clicking on an attribute badge, it's possible to scroll to individual attributes with a smooth animation.
@fscarponi fscarponi force-pushed the fabrizio.scarponi/PKGS-1104-Platform-panel branch from ebb58df to e228959 Compare January 10, 2024 12:54
@@ -56,6 +56,7 @@ dependencies {
implementation(compose.desktop.windows_x64)
implementation(packageSearchCatalog.kotlinx.serialization.core)
implementation(packageSearchCatalog.jewel.bridge.ij233)
implementation(packageSearchCatalog.jewel.standalone)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lamba92 Standalone is mandatory for run the Compose Preview (i'm not sure if we need it as implementation)

object PackageSearchColors {
object Backgrounds {
fun packageItemHeader(): Color =
pickComposeColorFromLaf("ToolWindow.HeaderTab.selectedInactiveBackground")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

it seems ok in 241, but I'm expecting a different result in 232 and 233. This will be fixed in related branches (expecting that 232 and 233 should be fixed in different ways)

onClick = {
//this event should be handled when you click on a selected package to refresh side panel content
if (isSelected ) onPackageListItemEvent(
PackageListItemEvent.InfoPanelEvent.OnSelectedPackageClick(content.id)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

1 - select package X (the side panel shows the package details) -> onSelectionChange() does the job
2 - click on a header badge (side pane shows the platforms) -> onClick for badge does the job
3 - click again on package X (the side panel shows the header's platform details) -> onSelectionChange() has not been called cause the selection is not changed

possible solutions:
-> make headers selectable -> is not what we want (will not fix anyway the multiSelection Interaction)
-> handle this corner case -> when someone clicks on already selected package, set the correct content on the side panel

@lamba92 lamba92 merged commit 259a0d2 into master Jan 10, 2024
@lamba92 lamba92 deleted the fabrizio.scarponi/PKGS-1104-Platform-panel branch January 10, 2024 14:34
fscarponi added a commit that referenced this pull request Jan 10, 2024
…esTab (#9)

Refactor platformListMock to getter in HeaderAttributesTab
scrollToAttribute has CoroutineScope as receiver
rename InfoPanelContentEvent Attributes Declared into FromVariant and Search into FromSearch
rename Attributes Declared into FromVariant and Search into FromSearch

This commit adds InfoPanelContent Attributes for "Declared" type to the asPanelContent function, including the tab's title, variant's title, and attributes. A click event handler for the selected packages is also added to refresh the side panel content. A new event for package selection has been placed in 'PackageListItemEvent'. Furthermore, the attribute type name description and content title in the package search UI have been updated for clarity. The style of the 'Search' content in HeaderAttributesTab has also been modified to reduce redundancy and clarify display conditions. Now, by clicking on an attribute badge, it's possible to scroll to individual attributes with a smooth animation.

(cherry picked from commit 259a0d2)
fscarponi added a commit that referenced this pull request Jan 11, 2024
…esTab (#9)

Refactor platformListMock to getter in HeaderAttributesTab
scrollToAttribute has CoroutineScope as receiver
rename InfoPanelContentEvent Attributes Declared into FromVariant and Search into FromSearch
rename Attributes Declared into FromVariant and Search into FromSearch

This commit adds InfoPanelContent Attributes for "Declared" type to the asPanelContent function, including the tab's title, variant's title, and attributes. A click event handler for the selected packages is also added to refresh the side panel content. A new event for package selection has been placed in 'PackageListItemEvent'. Furthermore, the attribute type name description and content title in the package search UI have been updated for clarity. The style of the 'Search' content in HeaderAttributesTab has also been modified to reduce redundancy and clarify display conditions. Now, by clicking on an attribute badge, it's possible to scroll to individual attributes with a smooth animation.

(cherry picked from commit 259a0d2)
fscarponi added a commit that referenced this pull request Jan 11, 2024
…esTab (#9)

Refactor platformListMock to getter in HeaderAttributesTab
scrollToAttribute has CoroutineScope as receiver
rename InfoPanelContentEvent Attributes Declared into FromVariant and Search into FromSearch
rename Attributes Declared into FromVariant and Search into FromSearch

This commit adds InfoPanelContent Attributes for "Declared" type to the asPanelContent function, including the tab's title, variant's title, and attributes. A click event handler for the selected packages is also added to refresh the side panel content. A new event for package selection has been placed in 'PackageListItemEvent'. Furthermore, the attribute type name description and content title in the package search UI have been updated for clarity. The style of the 'Search' content in HeaderAttributesTab has also been modified to reduce redundancy and clarify display conditions. Now, by clicking on an attribute badge, it's possible to scroll to individual attributes with a smooth animation.

(cherry picked from commit 259a0d2)
fscarponi added a commit that referenced this pull request Jan 11, 2024
…esTab (#9)

Refactor platformListMock to getter in HeaderAttributesTab
scrollToAttribute has CoroutineScope as receiver
rename InfoPanelContentEvent Attributes Declared into FromVariant and Search into FromSearch
rename Attributes Declared into FromVariant and Search into FromSearch

This commit adds InfoPanelContent Attributes for "Declared" type to the asPanelContent function, including the tab's title, variant's title, and attributes. A click event handler for the selected packages is also added to refresh the side panel content. A new event for package selection has been placed in 'PackageListItemEvent'. Furthermore, the attribute type name description and content title in the package search UI have been updated for clarity. The style of the 'Search' content in HeaderAttributesTab has also been modified to reduce redundancy and clarify display conditions. Now, by clicking on an attribute badge, it's possible to scroll to individual attributes with a smooth animation.

(cherry picked from commit 259a0d2)
lamba92 pushed a commit that referenced this pull request Jan 11, 2024
…esTab (#9)

Refactor platformListMock to getter in HeaderAttributesTab
scrollToAttribute has CoroutineScope as receiver
rename InfoPanelContentEvent Attributes Declared into FromVariant and Search into FromSearch
rename Attributes Declared into FromVariant and Search into FromSearch

This commit adds InfoPanelContent Attributes for "Declared" type to the asPanelContent function, including the tab's title, variant's title, and attributes. A click event handler for the selected packages is also added to refresh the side panel content. A new event for package selection has been placed in 'PackageListItemEvent'. Furthermore, the attribute type name description and content title in the package search UI have been updated for clarity. The style of the 'Search' content in HeaderAttributesTab has also been modified to reduce redundancy and clarify display conditions. Now, by clicking on an attribute badge, it's possible to scroll to individual attributes with a smooth animation.

(cherry picked from commit 259a0d2)
lamba92 pushed a commit that referenced this pull request Jan 11, 2024
…esTab (#9)

Refactor platformListMock to getter in HeaderAttributesTab
scrollToAttribute has CoroutineScope as receiver
rename InfoPanelContentEvent Attributes Declared into FromVariant and Search into FromSearch
rename Attributes Declared into FromVariant and Search into FromSearch

This commit adds InfoPanelContent Attributes for "Declared" type to the asPanelContent function, including the tab's title, variant's title, and attributes. A click event handler for the selected packages is also added to refresh the side panel content. A new event for package selection has been placed in 'PackageListItemEvent'. Furthermore, the attribute type name description and content title in the package search UI have been updated for clarity. The style of the 'Search' content in HeaderAttributesTab has also been modified to reduce redundancy and clarify display conditions. Now, by clicking on an attribute badge, it's possible to scroll to individual attributes with a smooth animation.

(cherry picked from commit 259a0d2)
lamba92 pushed a commit that referenced this pull request Jan 11, 2024
…esTab (#9)

Refactor platformListMock to getter in HeaderAttributesTab
scrollToAttribute has CoroutineScope as receiver
rename InfoPanelContentEvent Attributes Declared into FromVariant and Search into FromSearch
rename Attributes Declared into FromVariant and Search into FromSearch

This commit adds InfoPanelContent Attributes for "Declared" type to the asPanelContent function, including the tab's title, variant's title, and attributes. A click event handler for the selected packages is also added to refresh the side panel content. A new event for package selection has been placed in 'PackageListItemEvent'. Furthermore, the attribute type name description and content title in the package search UI have been updated for clarity. The style of the 'Search' content in HeaderAttributesTab has also been modified to reduce redundancy and clarify display conditions. Now, by clicking on an attribute badge, it's possible to scroll to individual attributes with a smooth animation.

(cherry picked from commit 259a0d2)
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