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

[iOS] Home - Activity Indicator #1282

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

JPKribs
Copy link
Member

@JPKribs JPKribs commented Oct 20, 2024

Originally Discussed

#1269 (reply in thread)

Summary

Creates an optional indicator to the HomeView that shows how many active sessions are currently active on the Server. Active sessions are online sessions where there is a nowPlayingItem.

This indicator has an action tied to it. Selecting this indicator takes the user to the AdminDashboard.

Considerations

  • I baked the viewModel into the ActiveSessionsIndicator. The reason I did this was because I didn't want to add an extra viewModel to the HomeView if the setting was disabled or the user was a non-admin. This way, only when the indicator is present is the viewModel attached to the HomeView.
  • This viewModel loads onAppear and every 60 seconds. The video below I changed this to every 4 seconds to capture what that looks like better.

Screenshot

Inactive Indicator Screenshot 2024-10-19 at 22 00 10
Active Indicator Screenshot 2024-10-19 at 22 01 57
New Setting (Only Visible when User.isAdministrator) I had to inject currentUserSession to get this. I hope that was right? Screenshot 2024-10-19 at 21 18 43

…this would work better if all of the Admin Dashboard items were in their own dashboard.
Copy link
Contributor

@chickdan chickdan left a comment

Choose a reason for hiding this comment

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

You are killing it with all of these PRs

@LePips
Copy link
Member

LePips commented Oct 21, 2024

Apologies, but I don't think I want the loading indicator. At least with its design, it doesn't have precedent anywhere else and is more Material than native iOS. I think we can do away with a loading design entirely and not worry about it.

Too bad .badge isn't implemented for navigation toolbar items currently, but I'll have to think about how we want the session count to look. These aren't as pressing as notifications, but it would at least match other native design.

https://ondrej-kvasnovsky.medium.com/how-display-a-notification-count-badge-in-swiftui-f4fd243f557

@JPKribs
Copy link
Member Author

JPKribs commented Oct 21, 2024

No worries! That was quick to throw together and I'm not in love with that design. If I ever stopped the circle spinning, it'd break next time it started spinning (at least on emulator) so I just had to swap it out for a hidden non-circle...

If we aren't worried about a loading indicator for this item I'd be more than happy to pull this part!

I'll take a crack at what you sent and I'll throw in a screenshot of what that looks like to see if this is a better fit!

@JPKribs
Copy link
Member Author

JPKribs commented Oct 21, 2024

Too bad .badge isn't implemented for navigation toolbar items currently, but I'll have to think about how we want the session count to look. These aren't as pressing as notifications, but it would at least match other native design.

https://ondrej-kvasnovsky.medium.com/how-display-a-notification-count-badge-in-swiftui-f4fd243f557

I'm a fan of this! I think this is an improvement. Well, minus the colors I picked. Should I change the indicator color or the badge color? I was thinking about a make just accentColor with .75 opacity white on top but I thought you'd probably have something a little less custom as a solution.

Also, I think I am going to remove the spacing 0 from the HomeView for this since it's getting a little too close together. I've included what that looks like as the last image. See below:

Screenshot 2024-10-21 at 09 16 12 Screenshot 2024-10-21 at 09 17 17 Screenshot 2024-10-21 at 09 16 53 Screenshot 2024-10-21 at 09 24 59

@JPKribs
Copy link
Member Author

JPKribs commented Oct 23, 2024

The badge, IMO, looks like an improvement. How do we feel about the colors. This is .fill(secondary)

Screenshot 2024-10-22 at 23 24 04 Screenshot 2024-10-22 at 23 24 20 Screenshot 2024-10-22 at 23 24 36 Screenshot 2024-10-22 at 23 24 50

@LePips
Copy link
Member

LePips commented Oct 23, 2024

I don't think that has enough contrast with itself. I think we will have to have a "divider" outside of the badge.

Screenshot 2024-10-23 at 4 56 25 PM

@JPKribs
Copy link
Member Author

JPKribs commented Oct 23, 2024

I don't think that has enough contrast with itself. I think we will have to have a "divider" outside of the badge.

Screenshot 2024-10-23 at 4 56 25 PM

That's a big improvement as well! Are we fine with both being accent color variations? I like it but I'm never going to claim I have good taste

@LePips
Copy link
Member

LePips commented Oct 24, 2024

Honestly probably not, but I will go through some designs.

@sjorge
Copy link

sjorge commented Oct 24, 2024

I think them both being a variation looks fine as is, it also nice that aside from posters nearly everything somehow follows the accent color set by the user.

On the otherhand the contrast might be a bit to low between them, I wonder how it looks with either solid white or black depending on on dark or light theme. The border+text is obvious inverted from the fill color. That should give a big contrast and because it's on the grayscale spectrum like the other non accented colors, it should still look fine. 🤞

@JPKribs
Copy link
Member Author

JPKribs commented Oct 24, 2024

I think my plan is hold off on anything new (from my end) for AdminDashboard until #1284 & #1287 are merged.

Then, move all of the AdminDashboard from the SettingsView > UserDashboard into their own standalone AdminDashboard folder. From there, I want to put all of AdminDashboard views on their own coordinator and I can reference that here as the onSelect action for the indicator.

So, I think we have some time for formatting/style choice! For the time being, I think I'm going to move this to draft. I'd like to just get the indicator done in one merge rather than adding a 1 line merge after the coordinator changes.

@JPKribs JPKribs marked this pull request as draft October 24, 2024 16:24
@JPKribs
Copy link
Member Author

JPKribs commented Oct 27, 2024

I'm going to place this on a more permanent hold until #1289 is resolved. I think this is going to be related to something that changed in 10.10 that would be reflected in future SDK changes. The good news, I now have a good confirmation that the error icon is working on this PR:

Screenshot 2024-10-26 at 20 24 26

The bad news, with Swiftfin being on 10.8 as a base, I would guess that we're a ways off from getting on getting to a base 10.10. So this change might be a longer term ambition.

I'm going to keep this in draft for now and we'll play it by ear moving forward!

@JPKribs JPKribs added enhancement New feature or request and removed enhancement New feature or request labels Nov 24, 2024
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.

4 participants