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

[WIP] Left-Sidebar updated #64

Merged
merged 7 commits into from
Jun 9, 2021
Merged

[WIP] Left-Sidebar updated #64

merged 7 commits into from
Jun 9, 2021

Conversation

priyanshu0405
Copy link
Contributor

Hey @razzeee, I am working on Issue #34 and trying to add onMouseHover to all the icons in the left sidebar. There are some errors due to return type of view and I am facing problem fixing it. Can you can help me fix this or suggest a better way to do this .

@razzeee
Copy link
Member

razzeee commented May 30, 2021

A general observation, please don't work on your master/main branch. It's much better to create feature branches.

@priyanshu0405
Copy link
Contributor Author

Will take care of making branches from the next time. I am still facing the same issue after passing LeftSidebar.initialModel when calling view because it returns Element LeftSidebar.Msg and not Element msg.

@razzeee
Copy link
Member

razzeee commented May 31, 2021

I've pushed something to your branch, that seems to be a bit closer to solving this.

@priyanshu0405
Copy link
Contributor Author

It leads to the same type annotation problem because view returns Element Msg but we want it to return Element msg. Can map help us in some way?

@priyanshu0405
Copy link
Contributor Author

LeftSidebar completed and dropdown menu has been added to RightSidebar. Functionality is yet to be added to the RightSidebar.

LeftSidebar
l

RightSidebar dropdown menu
r

@@ -1,9868 +1,8 @@
{
"name": "elm-chorus",
"version": "1.0.0",
"lockfileVersion": 2,
"lockfileVersion": 1,
Copy link
Member

Choose a reason for hiding this comment

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

You might want to use a newer version of npm (version 14 at least) as we would like to use the newer version of the package lock

@@ -45,3 +46,21 @@ view rightSidebarExtended rightSidebarMsg panelHeight connection =
[ height (px panelHeight), width (px 50), Background.color Colors.playlistBackground, alignRight, htmlAttribute <| Html.Attributes.style "pointer-events" "all" ]
[ Input.button [ centerX, height (px 50) ] { onPress = Just rightSidebarMsg, label = Element.text "<" }
]

rightSidebarMenuDropDown : Bool -> List (Attribute msg)
rightSidebarMenuDropDown rightSidebarMenu =
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be good to name rightSidebarMenu something along the lines of isRightSidebarMenuVisible or showRightSidebarMenu. As it was very unclear to me, what this variable was about, when I saw it in the other places that the name is used.

src/Shared.elm Outdated
@@ -50,6 +50,16 @@ type alias Model =
, connection : Connection
, rightSidebarExtended : Bool
, controlMenu : Bool
, musicHover : Bool
Copy link
Member

Choose a reason for hiding this comment

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

While this works, I would recommend to have a custom type that represents what is hovered. As there is only ever one thing that can be hovered in this case.
This has a lot more possible states, that might happen and are unwanted. Basically all states that are have more then one true.

It would be nicer with type LeftSidebarMenuHover = None | Music | Movies | ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have checked the model and application, at a time only one icon can be hovered and no other states are possible. Do I still need to make any changes to the model?

Copy link
Member

Choose a reason for hiding this comment

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

I would recommend it, as it vastly improves the design of your store and thus the handling. Also, while you think it's not possible, eliminating it at the source will make it impossible to happen.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I think you are right. I will start working on it straight away.

@razzeee
Copy link
Member

razzeee commented Jun 6, 2021

In general this looks okay, there are a lot of places where we can possibly shorten the code. But I think we should start slow, so this is fine to me. Please have a look at the other comments, before this can be merged.

@priyanshu0405
Copy link
Contributor Author

Okay will try to solve all of them one by one.

@priyanshu0405
Copy link
Contributor Author

@razzeee , please have a look.

@razzeee
Copy link
Member

razzeee commented Jun 9, 2021

LGTM, thank you

@razzeee razzeee merged commit 3b7202b into xbmc:main Jun 9, 2021
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