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 support for Window Controls Overlay #53

Merged
merged 9 commits into from
Apr 17, 2024

Conversation

DellZHackintosh
Copy link
Contributor

Originally mentioned in Flarum Discuss, and this pull aims to add that support.
Changed 3 files in order to add the setting and write the display_override item into the manifest.
Though there's few supports for Window Controls Overlay for Flarum (maybe there's only some of my attempts), it's in line with the current goal.

Copy link
Contributor

@luceos luceos left a comment

Choose a reason for hiding this comment

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

It would be easier for a maintainer to understand the proposed changes if you clarified why it is needed. Adding screenshots, related articles and a wider motivation to the PR would be really helpful.

I've left some things as a review that seem to need improvement. As I'm not a maintainer of this package, I cannot guarantee the PR to merged regardless of further effort to make the changes I mentioned.

@@ -32,6 +32,12 @@ askvortsov-pwa:
push_notif_preference_default_to_email_text: If true, users will have push notifications enabled by default for all notification types where email notifications are enabled by default. If false, users will have push notifications disabled by default.
user_max_subscriptions_label: Max Push Subscriptions Per User
user_max_subscriptions_text: How many push subscriptions should each user be able to have at a time? When a user receives a push notification, each subscription will result in an API call. Each subscription typically corresponds to a browser the user has used.
windowControlsOverlay_label: Enable Window Controls Overlay?
windowControlsOverlay_text: |
If true, users will able to enable Window Controls Overlay to create an immersive, native-like experience. Window Controls Overlay enables or not depends on user's preference and browser's compatibility. You also should be sure you've done something to match this feature.
Copy link
Contributor

Choose a reason for hiding this comment

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

You should be sure you've done something to match this feature.

What does that even mean or imply?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, it may not be described clearly. As the text mentioned, we must do something to adapt the UI changes.
Specifically speaking, after enabling this feature, the titlebar will disappear and only leave the three controls. Flarum doesn't do anything for that, so you'll have a bad window. For example:
Not adapted with Window Controls Overlay
Just like that. So you're needed to do is just write some CSS to "match this feature". For example (Please pay attention to the position changes of the elements on the titlebar):
Adapted
That's all. Since the description text is considered as incomprehensible, maybe it's necessary to rewrite it......If someone can provide help, I would be grateful.

Fix misspelled variable

Co-authored-by: Daniël Klabbers <[email protected]>
@DellZHackintosh
Copy link
Contributor Author

It would be easier for a maintainer to understand the proposed changes if you clarified why it is needed.

It just influences the appearance of the PWA and it even not supported by all browsers.
But as I have explained, it's in line with the current goal (To do: Support configuration of ALL webmanifest attributes), so I made this.

Copy link
Owner

@askvortsov1 askvortsov1 left a comment

Choose a reason for hiding this comment

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

Overall lgtm, sorry for not getting to this earlier! Left a few wording / style nits.

I do worry slightly that the need to provide custom CSS / JS in addition to enabling the feature will lead to confusion for less technical forum admins; how would you feel about labelling this as an "advanced" setting"?

@DellZHackintosh
Copy link
Contributor Author

No problem! For the advice, yes, the feature itself and my description text will do make the admins confused. The feature itself doesn't have the ability to add any code to adapt the overlayed controls, it just hide the native titlebar, even also can't change its size, position or other though it. Besides, the CSS/JS code can only be added by other possible way.
Mark it as "advanced" and the links I have provided maybe will do help, but it seems that I should think a clearer description text...
How about this one?

          If true, users will be able to get an more immersive, native-like experience by hiding the native titlebar. Window Controls Overlay enables or not depends on user's preference and browser's compatibility. You must customize your titlebar by adding some CSS/JS after enabled, or the controls will overlay some elements of your forum's top navbar and the window almost can't drag, resulting a bad experience.

@askvortsov1
Copy link
Owner

How do you feel about the wording change I proposed in the review comments?

@DellZHackintosh
Copy link
Contributor Author

It is indeed easier to understand, although the description of the feature can be misleading.

@askvortsov1
Copy link
Owner

Fair enough. I'm happy with your newest proposed wording, except for the "users will be able to" part, because this is something configured per-forum, not per-user

@DellZHackintosh
Copy link
Contributor Author

DellZHackintosh commented Apr 14, 2024

except for the "users will be able to" part, because this is something configured per-forum, not per-user

No. Please pay attention to it:
The Button of disabling the feature
With this button, users can switch the feature. So that's why this feature should depend on users. By the way, the feature is disabled until users press that button. 😂

@askvortsov1
Copy link
Owner

Ah. Right. Yeah that's completely valid, totally missed it, sorry. Your wording sounds good then!

@DellZHackintosh
Copy link
Contributor Author

Well, it's all right now.

@DellZHackintosh
Copy link
Contributor Author

@askvortsov1 The recommendations have been implemented.

@askvortsov1 askvortsov1 merged commit be8cd18 into askvortsov1:master Apr 17, 2024
2 of 8 checks passed
@DellZHackintosh
Copy link
Contributor Author

Thanks very much! I'll keep on adding more features to it. 😊

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