#206 | 2698127-206.patch | 49.17 KB | Albert Volkman |
|
#187 | reroll_diff-177-187.txt | 8.31 KB | Spokje |
#187 | 2698127-187.patch | 50.96 KB | Spokje |
|
#186 | 2698127-186.patch | 50.79 KB | viappidu |
|
#185 | 2698127-185.patch | 53.98 KB | viappidu |
|
#180 | interdiff_178-180.txt | 545 bytes | munish.kumar |
#180 | 2698127-180.patch | 50.95 KB | munish.kumar |
|
#178 | 2698127-178.patch | 50.99 KB | mikemiles86 |
|
#177 | interdiff_175-177.txt | 529 bytes | raman.b |
#177 | 2698127-177.patch | 50.9 KB | raman.b |
|
#175 | interdiff_173-175.txt | 2.96 KB | raman.b |
#175 | 2698127-175.patch | 50.86 KB | raman.b |
|
#173 | core-manifest-2698127-173.patch | 50.61 KB | nod_ |
|
#172 | core-manifest-2698127-172.patch | 31.64 KB | nod_ |
|
#166 | interdiff-2698127-165-166.txt | 114.98 KB | martin107 |
#166 | 2698127-166.patch | 84.39 KB | martin107 |
|
#165 | 2698127-165.patch | 199.4 KB | martin107 |
|
#163 | interdiff-2698127-162-163.txt | 1.32 KB | martin107 |
#163 | 2698127-163.patch | 105.87 KB | martin107 |
|
#162 | 2698127-162.patch | 51.84 KB | martin107 |
|
#162 | interdiff-2698127-161-162.txt | 1.15 KB | martin107 |
#161 | interdiff-2698127-159-161.txt | 894 bytes | martin107 |
#161 | 2698127-161.patch | 51.47 KB | martin107 |
|
#159 | 2698127-159.patch | 51.74 KB | martin107 |
|
#158 | 2698127-158.patch | 51.5 KB | martin107 |
|
#155 | 2698127-155.patch | 51.5 KB | martin107 |
|
#155 | interdiff-2698127-154-155.patch | 6.73 KB | martin107 |
|
#154 | interdiff-2698127-147-154.txt | 2.66 KB | martin107 |
#154 | 2698127-154.patch | 53.4 KB | martin107 |
|
#150 | 2698127-150.patch | 53.25 KB | Manuel Garcia |
|
#150 | interdiff-2698127-148-150.txt | 1.07 KB | Manuel Garcia |
#148 | 2698127-148.patch | 53.25 KB | Manuel Garcia |
|
#148 | interdiff-2698127-147-148.txt | 908 bytes | Manuel Garcia |
#147 | 2698127-147.patch | 53.34 KB | martin107 |
|
#147 | interdiff-2698127-145-147.txt | 822 bytes | martin107 |
#145 | 2698127-145.patch | 53.27 KB | Manuel Garcia |
|
#145 | interdiff-2698127-143-145.txt | 815 bytes | Manuel Garcia |
#143 | 2698127-143.patch | 53.27 KB | Manuel Garcia |
|
#143 | interdiff-2698127-141-143.txt | 4.52 KB | Manuel Garcia |
#141 | interdiff-2698127-139-141.txt | 7.02 KB | martin107 |
#141 | 2698127-141.patch | 53.34 KB | martin107 |
|
#139 | interdiff-2698127-138-139.txt | 3.76 KB | martin107 |
#139 | 2698127-139.patch | 53.32 KB | martin107 |
|
#138 | 2698127-138.patch | 49.46 KB | Manuel Garcia |
|
#138 | interdiff-2698127-136-138.txt | 5.48 KB | Manuel Garcia |
#136 | 2698127-136.patch | 46.24 KB | Manuel Garcia |
|
#136 | interdiff-2698127-134-136.txt | 1.25 KB | Manuel Garcia |
#134 | 2698127-134.patch | 46.25 KB | martin107 |
|
#134 | interdiff-2698127-132-134.txt | 1.2 KB | martin107 |
#132 | interdiff-2698127-130-132.txt | 967 bytes | martin107 |
#132 | 2698127-132.patch | 46.21 KB | martin107 |
|
#130 | interdiff-2698127-128.130.txt | 747 bytes | martin107 |
#130 | 2698127-130.patch | 46.04 KB | martin107 |
|
#128 | interdiff-2698127-126-128.txt | 5.46 KB | martin107 |
#128 | 2698127-128.patch | 46.01 KB | martin107 |
|
#126 | interdiff-2698127-125-126.txt | 9.77 KB | martin107 |
#126 | 2698127-126.patch | 44.98 KB | martin107 |
|
#125 | 2698127-125.patch | 43.11 KB | martin107 |
|
#120 | interdiff-2698127-118-120.txt | 10.97 KB | martin107 |
#120 | 2698127-120.patch | 45.45 KB | martin107 |
|
#118 | interdiff-2698127-115-118.txt | 2.34 KB | yogeshmpawar |
#118 | 2698127-118.patch | 41.57 KB | yogeshmpawar |
|
#115 | interdiff-2698127-113-115.txt | 2.27 KB | martin107 |
#115 | 2698127-115.patch | 41.48 KB | martin107 |
|
#110 | InvalidManifest.png | 41.66 KB | martin107 |
#110 | interdiff-2698127-108-110.txt | 12.79 KB | martin107 |
#110 | 2698127-110.patch | 38.68 KB | martin107 |
|
#108 | 2698127-108.patch | 36.07 KB | martin107 |
|
#108 | interdiff-2698127-106-108.txt | 843 bytes | martin107 |
#106 | 2698127-106-interdiff.txt | 3.47 KB | wannesdr |
#106 | 2698127-106.patch | 36.03 KB | wannesdr |
|
#102 | 2698127-102.patch | 35.66 KB | yogeshmpawar |
|
#100 | 2698127-100.patch | 35.89 KB | wannesdr |
|
#100 | 2698127-100-interdiff.txt | 2.55 KB | wannesdr |
#95 | interdiff-2698127-88-95.txt | 1.32 KB | martin107 |
#95 | 2698127-95.patch | 35.95 KB | martin107 |
|
#88 | 2698127-88.patch | 35.81 KB | Manuel Garcia |
|
#86 | interdiff-2698127-72-85.txt | 7.45 KB | Manuel Garcia |
#85 | interdiff-2698127-72-85.txt | 4.13 KB | Manuel Garcia |
#85 | extend_site_informat-2698127-85.patch | 35.63 KB | Manuel Garcia |
|
#72 | interdiff-2698127-70-72.txt | 941 bytes | ronaldtebrake |
#72 | 2698127-72.patch | 35.07 KB | ronaldtebrake |
|
#70 | interdiff-2698127-68-70.txt | 941 bytes | ronaldtebrake |
#70 | 2698127-70.patch | 35.37 KB | ronaldtebrake |
|
#68 | interdiff-2698127-67-68.txt | 7.56 KB | ronaldtebrake |
#68 | 2698127-68.patch | 35.36 KB | ronaldtebrake |
|
#67 | 2698127-67.patch | 31.44 KB | borisson_ |
|
#67 | interdiff-2698127.txt | 1.43 KB | borisson_ |
#65 | 2698127-65.patch | 31.53 KB | borisson_ |
|
#65 | interdiff-2698127.txt | 7.29 KB | borisson_ |
#63 | 2698127-63.patch | 30.57 KB | borisson_ |
|
#63 | interdiff-2698127.txt | 8.93 KB | borisson_ |
#59 | extend_site_information-2698127-59.patch | 28.31 KB | borisson_ |
|
#59 | interdiff-2698127.txt | 2.52 KB | borisson_ |
#58 | interdiff-2698127-54-58.txt | 2.59 KB | ronaldtebrake |
#58 | extend_site_information-2698127-58.patch | 28.39 KB | ronaldtebrake |
|
#54 | extend_site_information-2698127-54.patch | 27.98 KB | borisson_ |
|
#54 | interdiff-2698127.txt | 992 bytes | borisson_ |
#52 | extend_site_information-2698127-52.patch | 27.96 KB | borisson_ |
|
#51 | extend_site_information-2698127-51.patch | 88.89 KB | borisson_ |
|
#51 | interdiff-2698127.txt | 6.55 KB | borisson_ |
#49 | extend_site_information-2698127-49.patch | 23.36 KB | borisson_ |
|
#49 | interdiff-2698127.txt | 5.65 KB | borisson_ |
#47 | extend_site_information-2698127-47.patch | 19.37 KB | borisson_ |
|
#47 | interdiff-2698127.txt | 4.08 KB | borisson_ |
#43 | extend_site_information-2698127-43.patch | 17.61 KB | borisson_ |
|
#43 | interdiff-2698127.txt | 5.27 KB | borisson_ |
#41 | extend_site_information-2698127-41.patch | 15.64 KB | borisson_ |
|
#41 | interdiff-2698127.txt | 7.19 KB | borisson_ |
#36 | interdiff-2698127.txt | 2.94 KB | borisson_ |
#36 | extend_site_information-2698127-36.patch | 14.1 KB | borisson_ |
|
#34 | extend_site_information-2698127-34.patch | 14.51 KB | borisson_ |
|
#34 | interdiff-2698127.txt | 9.11 KB | borisson_ |
#32 | extend_site_information-2698127-32.patch | 9.63 KB | borisson_ |
|
#32 | interdiff-2698127.txt | 8.9 KB | borisson_ |
#28 | extend_site_information-2698127-28.patch | 5.84 KB | borisson_ |
|
#28 | interdiff-2698127.txt | 2.65 KB | borisson_ |
#25 | extend_site_information-2698127-25.patch | 4.98 KB | borisson_ |
|
#21 | interdiff-2698127-18-21.txt | 2.52 KB | fgm |
#21 | core-manifest-2698127-21.patch | 6.39 KB | fgm |
|
#19 | interdiff-2698127-18-19.txt | 1.81 KB | fgm |
#19 | core-manifest-2698127-19.patch | 6.32 KB | fgm |
|
#18 | core-manifest-2698127-18.patch | 5.57 KB | ronaldtebrake |
|
#17 | core-manifest-2698127-17.patch | 5.57 KB | frankgraave |
|
#12 | core-manifest-2698127-12.patch | 4.22 KB | erik.erskine |
|
#4 | core-manifest-2698127-4.patch | 4.24 KB | nod_ |
|
Comments
Comment #2
heddnThese all feel like things for which I'd use metatags module. Are we sure this might not be a better fit in contrib?
Comment #3
nod_From the metatag module description the module address the issue of SEO and content display on social platform. This has nothing to do with what the manifest file is about. So it wouldn't be a good fit.
The manifest file is really lightweight, needing a module to provide it is overkill. And it should be in core, mobile initiative & all that. It's a low risk/high reward thing. for more details on what the manifest file do check out: Bruce Lawson: Progressive Web Apps: the future of Apps slides, from slide #13 it's all about the manifest file.
Comment #4
nod_Don't have time to do more but for now here is a start of something. Adds the extra infos needed out of users to generate the manifest file. The rest we can take from default logo, site name & all.
Comment #5
dawehnerSo the idea is to generate some route which serves this file?
Comment #6
nod_We can generate a real file and stick that in public://, it'll end up being used as much as robots.txt and favicon.ico no need to make it expensive, it doesn't need to be dynamic.
After all the manifest file is a href in a link tag, not too hard to change the href to point to something else if a module want to.
Comment #7
dawehnerGood point, as we can specify the path, there is no reason to not just generate it.
Comment #11
erik.erskine CreditAttribution: erik.erskine commentedComment #12
erik.erskine CreditAttribution: erik.erskine commentedRe-roll of #4, also using short array syntax.
Comment #13
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation for Pfizer, Inc. commentedReroll looks good, thanks @erik.erskine.
I believe this requires an upgrade path since its setting new configuration.
Comment #15
nod_With some reflections I think we should let all those values come from the theme info file:
added the meta theme-color in the IS to be able to have 100% coverage on lighthouse reports.
Comment #16
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation for Pfizer, Inc. commentedComment #17
frankgraave CreditAttribution: frankgraave for Open Social commentedHi there,
Nice to see this! I have added some fields in the manifest form:
While the 'short_name' takes care of the name on mobile devices, the 'name' is the longer (site)name that will be used when you pin it on your homescreen in desktop browsers (e.g. chrome://apps/). The 'name' field will be automatically filled with the 'site_name' unless you change the value yourself.
I've also added a icon field. Probably the nicest thing of the manifest since it will allow you to provide that 'app-like' feel when you pin to your homescreen. However, this topic could use some discussion. It's ideal to have at least the following resolution icons:
So the big question is, how should we deal with those different icon resolutions to provide a valid icon for the most mobile devices? Here's my take on it along with the question marks I have:
Comment #18
ronaldtebrake CreditAttribution: ronaldtebrake as a volunteer and for Open Social commentedThanks for the patch, it was corrupt probably because a line was removed.
Re-applied your changes, and uploaded a working patch below.
Comment #19
fgmThis should have less errors. Not sure what the proper schema is for a sequence of files, though.
Comment #21
fgmNo idea why I can't run the tests locally (phpunit no longer throws the schema errors but marks all tests as skipped). Locally these tests threw in the previous version, and are now marked skipped, unlike the CI bot.
Comment #23
fgmFWIW these tests now pass locally on 8.5.x HEAD using this command line:
sudo -u _www php core/scripts/run-tests.sh --verbose --sqlite /tmp/test.sqlite --url http://drop8.localhost Ajax
(to run the Ajax group which is the first failing here).
Comment #24
fgmSeems to be a problem with the CI use of the --concurrency flag. When I run these tests with concurrency = 8, I get this:
While without concurrency the result is:
Comment #25
borisson_I agree with #15, this shouldn't come from the system information - at least not all of it. Most of this should be defined in the theme. So the latest patches aren't very useful I think.
The questions in #17:
1. Using the theme logo as default is probably not going to yield good results for most sites.
2. Uploading one 256x256 file and resizing that sounds like a good solution!
In the attached patch I propose a new service to fill the data, not all of it is implemented yet.
Consider this to be a work in progress and not even close to finished, but just an idea. I would like to get feedback on a couple of things:
public://
directory?Comment #26
nod_Thanks so much for getting that going. Did not have the courage to take it on.
I agree some of it needs to be the theme's responsibility but not all of it, I'd like to keep alter possibility, replacing the whole thing to change one field or two seems overkill.
Adding UX folks so they can give us advice on what to do.
Comment #28
borisson_CS fixes + config subscriber to remove the manifest.json when the system settings changes. Also now using the file in the public directory.
Comment #30
nod_I'd like to have a mix of the two patches. We need a separate short_name field that is different from the site name and some display options are more about the whole site, not just the theme. Theme should provide the
*_color
values and maybeorientation
but thedisplay
is definitely site-wide.Also we can't use the
page.front
path. Drupal uses that to render "/" but to the progressive web app (or the shortcut generated by the manifest) it's just "/", not the drupal path.I don't think a toogle in the theme to activate the manifest is useful, it should always be there. We have a default favicon, it's on the same level as that.
Comment #31
juliencarnot CreditAttribution: juliencarnot at oqp.io commentedI agree with @nod_ on #30. Regarding the start_url , it should be defined site-wide and configurable: to offer an app-like experience, it might point to another page than the homepage or even to a form.
Comment #32
borisson_Still to do:
- Set configuration in theme and get information from it.
- add alter hook
- test all the things.
Done in this patch.
- Merge part of the work previous contributors did into this patch.
- Hopefully fix some of the tests
- Automatically generate the file everytime (remove the theme switch)
Comment #34
borisson_All information should now come from the correct locations, would love to get feedback before writing tests. I don't think I'll be able to spend a lot of time on this the next couple of days so if someone would like to pick this up - feel free.
We should still fix the icon though.
I also think we should make give this a language-context (if at all possible with the current approach), we should probably also make this vary by active theme.
I think those are good reasons to reconsider @dawehner's point about making this into a route instead of a file.
Comment #36
borisson_I don't think we should make the direction configurable, every language object already has that information. So we can reuse it.
Comment #38
idebr CreditAttribution: idebr at ezCompany commentedReading the spec (https://www.w3.org/TR/appmanifest) it appears one is not limited to one manifest file by design.
Comment #39
borisson_1. There is no multilingual implementation right now, currently the only thing we do is generate a manifest for the first language that gets accessed. There are 2 options to make this work.
a) Make this into a route instead of generated file, and add cacheability metadata.
b) Generate several files and serve different files based on the cacheability metadata.
2. We should, but don't.
I think the route is a better approach to fix this.
Comment #40
nod_route +1 didn't think about it when I went with generating a file. My bad.
Comment #41
borisson_No longer makes the entire core rely on the json encoder service. This is not done yet. The cache metadata isn't bubbled yet.
However, this makes it into a route.
I think the tests shouldn't be as broken anymore.
Comment #43
borisson_The tests look to be failing in upgrade path tests, I think that's because the manifest file is added to update.php, we shouldn't do that. No idea how to do that though.
I added an alter hook, as well as a basic test.
Before spending more time on tests, I'd love to get feedback on the implementation as it is now.
Comment #45
juliencarnot CreditAttribution: juliencarnot at oqp.io commentedThanks @borisson_!
I'd be happy to give it a try and to share my feedback. I don't have a fresh 8.5 install at hand, so I gave it a try on https://simplytest.me choosing the 8.5x branch with the patch #43, but install fails with this error, which seems related to the patch:
Comment #46
borisson_Looks like that is because the manifest.json is added on install.php and update.php. We should remove it from those - but like I mentioned in #43 I have no idea how to not do that.
Comment #47
borisson_This should fix the problem with update/install.
Comment #49
borisson_Test should be all green now.
Comment #50
ronaldtebrake CreditAttribution: ronaldtebrake as a volunteer and for Open Social commentedThanks for the great progress, really nice :). Like the approach on the route and love to see the tests are in there :).
Some first remarks/questions after some functional testing on simplytest.me.
<meta name="theme-color">
tag for branding color to compliment the values set inside manifest.json.If there is any help on development I can do let me know! Will leave it on needs review for others to check it out :)
Comment #51
borisson_The biggest outstanding thing right now is the files, and how we want to generate the different sizes of those, do we want to ship with predefined (locked) image styles or something else?
The other points you brought up are done. The validation is the same as the one color module used, so I moved that to system.
Comment #52
borisson_The patch in #51 is wrong, this one is correct.
Comment #54
borisson_Should fix the tests again - at least colortest is now green again locally - let's see if the rest is as well.
Comment #55
juliencarnot CreditAttribution: juliencarnot at oqp.io commentedI successfully installed and tested patch #54 and the UI part seems good to me! A couple remarks:
Comment #56
ronaldtebrake CreditAttribution: ronaldtebrake as a volunteer and for Open Social commented@55
This still needs to be tackled as mentioned in #51, but we need to come up with a solution on how to add the different sizes of the icon. See also the todo in code.
I agree we can provide this as an extra, optional (?), object in the manifest. Don't think we should use the site slogan for that. It's more for describing the purpose of the web application rather than showing the slogan of your website.
Comment #57
borisson_Self-review, most of these are just docs-updates. I'd be super happy if anyone fixes these.
We can do a description in a later followup, let's try to keep this as small as possible for now. It's already ~30kb and we still need to add better testcoverage + fix the logo. We don't want this to turn into an unreviewable monster later down the line :)
This documentation as it right now is useless. It should be expanded.
These shouldn't use \Drupal::config but use the configFactory object (that's already injected)
Looks like I copied this from another controller, the docs here are wrong.
Are we sure we need to extend controllerBase? If we're not using any of it, we should remove the extend here.
This is wrong, we're not returning a renderable array - we're returning a json response. Let's fix the docs.
Are we sure we want to just move this to a new global function, or should this move to a service somewhere? I guess for now the global function is good enough.
Needs a docblock.
Comment #58
ronaldtebrake CreditAttribution: ronaldtebrake as a volunteer and for Open Social commentedTried to pitch in a little and fix most of the above.
Still to do:
4.
6.
Comment #59
borisson_Comment #61
borisson_This should fix the broken tests.
Comment #62
dawehnerJust a question: Do we really use camelcase variable names? Sorry for my ignorant question.
I would have had a method $this->loadThemeConfig and a method doGenerateManifest and then a generateManifest which does both. ```generateData``` isn't really a helpful method name.
Is there a reason this is not injected?
Let's ensure to add a
@trigger_error
as I guess we treat this, just like everything else, as some sort of "API"?This render array bit feels so weird. I would rather introduce a new custom value object which implements \Drupal\Core\Cache\RefinableCacheableDependencyInterface and stores the needed data.
Can't you use
strpos($request->getScriptName(), 'update.php') === FALSE
or so?A random suggeston: Could we add a Drupal\Component\Utility helper class instead? This sounds for me like something which really doesn't have to exist in system module.
Comment #63
borisson_Thanks so much for the review daniel, that really helps!
Comment #65
borisson_Test should be green again now. I decided to remove the part about the file icon, we can do that as a followup later.
Still todo:
Move the
system_valid_hexadecimal_string
to aDrupal\Component\Utility helper
Comment #67
borisson_Comment #68
ronaldtebrake CreditAttribution: ronaldtebrake as a volunteer and for Open Social commentedMoved the system_valid_hexadecimal_string to a Drupal\Component\Utility helper.
Used Drupal\Component\Color for that, there was already a validateHex function in there, but that accepted strings like "cba" unfortunately that is not strict enough for the manifest.json. Also made sure the tests for both functions reflects the above use case.
Comment #69
borisson_The first line of documentation should be only 80 characters long and the rest should be in a new paragraph. Can we rewrite this?
This goes over the 80 cols line.
I like the new tests, great job on those!
Comment #70
ronaldtebrake CreditAttribution: ronaldtebrake as a volunteer and for Open Social commentedThanks a lot for the review!
Updated the documentation as per your comments.
Comment #72
ronaldtebrake CreditAttribution: ronaldtebrake as a volunteer and for Open Social commentedCreated the patch against 8.6.x
Notable changes (also see interdiff):
Necessary because of: https://www.drupal.org/project/drupal/issues/2849669
Still todo
According to the Lighthouse validation there should be at least two icon sizes rendered:
Can somebody maybe elaborate on how to tackle this best?
Imagestyle? Two separate upload fields with size restrictions?
Comment #73
borisson_I think an image style is the best idea, 2 file fields sounds like making it a lot harder for people when it's not really needed.
Also removed the needs tests tag, I think this has sufficient coverage as-is.
Comment #74
økse CreditAttribution: økse as a volunteer commentedUnit tests did run and passed. Functionality test setting the parameters from the manifest.json file works flawlessly.
A remark about the position of the site manifest parameters fieldset within the basic settings page though. Maybe it would be a good idea to not to nest within the site details fieldset?
Comment #75
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer commentedThis needs API documentation for
hook_manifest_alter()
.Comment #76
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer commentedThe manifest file is being served with a
Content-type: application/json
header, but it's supposed to beapplication/manifest+json
if we're following the W3C Web App manifest working draft.That draft also describes the file extension as
.webmanifest
but we currently jdon't have a file extension.Comment #77
borisson_We can change the header really easily, however creating a file is not possible, we tried that earlier and that was harder to fix for multilingual.
Comment #79
ruplUsing a JSON is an acceptable file extension for Web Manifest. The file's official structure is JSON so sites like MDN docs often suggest that JSON file extension is a safe convention.
I cleanly applied this to latest 8.7.x and it's still working. I found one issue while clicking through and trying out the admin UI:
I see that
browser
is the default Display setting in the YML but when I test this patch on a fresh installation I get "Fullscreen" as my default value when I load the form and save.So in terms of Lighthouse audit checkpoints, the two images sized 192/512 are necessary to make the site installable by default. In the contrib module we just use the Druplicon and I figure that's ok for core to do as well. The PNG inside
core/misc
is 88x110 but checking in two additional copies at the correct size seems like an easy path to "out of the box" functionality.Someone mentioned writing docs for the manifest alter hook. That's something I'm happy to do. Does it need to be in this patch or on a d.o page somewhere?
Comment #80
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation for Pfizer, Inc. commentedcore.api.php could be a good start perhaps? not sure.
This looks generic enough, and useful not only for manifests, can we refactor/add it somewhere more accessible?
Comment #81
borisson_@Manuel Garcia: I don't think we should do that, at least not yet. Opening this up to a general API might be useful, but this is a DX improvement we can always add somewhere in the future. For now, I'd like to keep the API surfuce of this patch as small as possible.
Comment #82
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer commentedIs there any reason why the ManifestGenerator can't just have a
Drupal\Core\Theme\ThemeSettings
member?Comment #83
borisson_I don't really understand #82.
Comment #84
larowlanIf data is just a keyed array, we're not really making the most of php5.4 memory optimisations.
Are there known keys here we should be making properties on the object?
If not - what is the value object adding that an array doesn't provide? Is it just to provide the cacheability methods?
Should we have a interface for this to allow alternative implementations?
would
$theme_specific_config->get('manifest')
work?these need a link to a change record
no need for " here, should be ' for consistency?
shouldn't these be passed through
$this->t()
?Should use $this->t()?
Can we use the third argument to in_array here. We're comparing strings, so we should be strict.
https://3v4l.org/949aT
e.g. this would be an ideal candidate for a ->getThemeColor method
Do they actually throw an exception?
We also need docs for the new hook, and the update path for the new config (with a test)
Looks great though, really valuable feature
Comment #85
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation for Pfizer, Inc. commentedThanks @larowlan for the review,
#84.1 - Probably, let's identify these.
#84.2 - Good idea, doing it here please have a look.
#84.3 - I think it should, doing so in this patch.
#84.4 - Yes, we need to write it first, adding the tag.
#84.5 - Good catch, done.
#84.6 - Yes they should, done.
#84.7 - Good catch, done.
#84.8 - Yup, done.
#84.9 - Possibly, lets first sort out #84.1
#84.10 - I don think so, this looks to test just
Color::validateStrictHex()
which returns the value from the preg_match(bool). Changed the comment to something more generic.Comment #86
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation for Pfizer, Inc. commentedOK that interdiff came out very wrong, here is the good one.
Comment #88
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation for Pfizer, Inc. commentedSigh back to the old way of generating patches then. Interdiff on #86 is good.
Comment #89
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation for Pfizer, Inc. commentedComment #90
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation for Pfizer, Inc. commentedStill needs work for these as far as I can tell:
Comment #91
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer commentedWe need to address WCAG SC 1.3.4 Orientation. Currently this patch prevent site-builders from producing a website that conforms to WCAG level AA.
I propose (maybe insist) we remove the orientation key entirely. Locking the orientation is justified only in rare cases, and including this setting seems irresponsible IMO. The alter hook provides a way to lock the orientation key for sites which can justify it.
I'll expand on this comment later. I'm on a rural bus journey right now.
Comment #92
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer commented@borisson_ Sorry I was too brief in #82.
It was about the loadThemeConfig() method in #80. Is this new method really necessary? There's already a ThemeSettings class which sorts out the global/theme-specific settings. Can manifestgenerator use this existing feature instead?
Comment #93
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer commentedThe "display" property also has some accessibility concerns.
When a user views a website in a browser, they have lots of useful tools built in to the browser: bookmarking a URL, find in page, share a URL to another app, Firefox add-ons for dictionary look-ups, reader mode, etc..
But when they save a "page" to the homescreen, the PWA manifest "display" property kicks in, and the user may loose access to some browser tools which they depend on - e.g. with "minimal-ui", PWAs on Android/Chrome do not offer bookmarking URLs. I'm highly skeptical of why many web sites would need to do this at all.
I'm not sure what happens if users add a PWA to their homescreen from Android/Firefox, but I'm concerned users will lose the ability to use Firefox addons which they rely on (like dictionary look-ups).
I think use of the "display" property could present problems for users with a large range of cognitive/learning impairments. I'll keep looking for articles which can provide more info on this. I don't think we'll find an outright WCAG failure here, but it's something we can provide guidance about for site builders, in the manifest settings form and help topics.
Comment #94
ruplTo address #91 concerns: Orientation is just specifying the default orientation. It's not a locking mechanism, rather a signal for what a given site considers its default or most useful orientation. There are more than just two options. Would setting
any
as a default alleviate the concerns you have?Other options listed at https://developer.mozilla.org/en-US/docs/Web/Manifest#orientation
Per #93 The display property is similar in that it's only as restrictive to accessibility as the individual settings allow. We can choose the most conservative default of
browser
and it won't be any different than a normal web page.If there's really a measurable problem with including these two properties by default, we could add a None option which still makes them easily adjustable without forcing one particular implementation on folks. See an example manifest with just the bare minimum of meta-data (Example1): https://www.w3.org/TR/appmanifest/#example-manifests
@andrewmacpherson do you have some links we could read explaining why these properties have negative effects on a11y? This is the first I've heard of it and I'm keen to learn more in case I need to adjust something in the contrib module.
Comment #95
martin107 CreditAttribution: martin107 as a volunteer commentedThis is just a minor observation, found while looking over the patch
t() is a antipattern, I have converted a couple of instances into $this->t().. only where we were adding new code.
Comment #96
mgiffordJust wanting to test #95
Comment #97
Wim LeersHigh-level review.
Implementing
RefinableCDI
makes this a mutable value object. In every other way this is immutable.Let's keep it immutable.
Inconsistent: URL vs page.
Display what? Based on the name, I though this was going to be a boolean.
How can these have the same label?
🎉
This is lacking the ability to influence cacheability.
Comment #98
heddnThe IS mentions icons, but there's no icons in the latest patch.
Comment #100
wannesdrNo activity for a long time, but brought to my attention by @borisson_, so thanks for the opportunity!
Attached is a new patch with the feedback by Wim + some additional improvements. I made the naming of the start_url more consistent in the SiteInformationForm.
I was also wondering if the manifest config this patch adds in system.site.yml must also be added to the Standard install profile system.site.yml config file? (and maybe the other install profiles as well?)
Comment #101
yogeshmpawarComment #102
yogeshmpawarRe-rolled the #100 patch against 8.8.x branch.
Comment #103
wannesdrThanks for the re-role @yogeshmpawar!
Hope we can move this forward now.
Comment #104
martin107 CreditAttribution: martin107 as a volunteer commentedA) Just pull out the "additional coding standard errors" out from the test artefacts
B) Also there are out of date deprecation notices being added.
The is movement to standardise this text. Here is a example from
https://www.drupal.org/core/deprecation
@trigger_error('baz() is deprecated in drupal:8.3.0 and is removed from drupal:9.0.0. Use \Drupal\Foo\Bar::baz() instead. See http://drupal.org/node/the-change-notice-nid', E_USER_DEPRECATED);
(b.2) drupal:8.8.0 is now the preferred label.
(b.3) "is removed from" is intentional so that code can linger in drupal:9.0.0 and be deleted in later minor releases. without warning.
I hope this helps.
Comment #105
wannesdrThanks @martin107 for the review, I will take a look
Comment #106
wannesdrNew patch with the feedback from @martin107.
I changed all the 'Boolean' occurrences to 'bool'. So it is consistent with the rest of Core.
Comment #107
martin107 CreditAttribution: martin107 as a volunteer commentedMy time is limited at the moment , but digging in the build artifacts
so that looks like a missing use statement, as addCacheContexts() is not under the Drupal\Core\Theme namespace
I hope this helps
Comment #108
martin107 CreditAttribution: martin107 as a volunteer commentedThis resolves what I described above
CacheableDependencyInterface becomes RefinableCacheableDependencyInterface
when to use a RefinableCacheableDependencyInterface?
https://www.drupal.org/node/2525764
Anyway locally ManifestGeneratorTest now passes.
Comment #109
borisson_Wim's remark in #97 was to remove RefinableCacheableDependencyInterface. Because that makes this VO mutable and it was immutable before. I don't see how we can keep this immutable without creating a new way to pass in the cacheability metadata.
So I think that means #108 is a good start. I think the next thing we should change is to allow for the cache data to also be passed to the new value object as well.
Comment #110
martin107 CreditAttribution: martin107 as a volunteer commented@borisson_ Oh ground swallow my up ... thanks for pointing out my mistake.
I should explain a few judgement calls I have made.
A)
Regarding the manifest.json file, I want to talk about mitigating the differences between what the spec says and what the disparate implementations do.
1) Name and manifest_version are the only required manifest key value pairs. So I have added "manifest_version" as a new form entry and made the 'name' field required.
Browser are pragmatic - If manifest_version is missing form the file then a default is assumed - but I want to follow the spec, while recognising it is not actually needed.
2) I have reworked the manifest_generator so that if, for example, theme_color is missing then instead of the key value pair being
'theme_color' => ''
we now omit the whole thing.
3) Given 2 - theme_color if it is blank then $page['#attached']['html_head'][] is no longer modified.
B) I went looking at the manifest.json generated by a 'standard' and 'unami' install. lots of value were null. Now placeholder values appear.
C) From now on php7.0.3 is required. For new code it is time to specify a return type
Here is a example of the change I have made to ManifestController. We can now mandate a CacheableJsonResponse. yay for 2019
So on my todo list
Returning to the difference between spec and implementation.
D) Chrome generates lots of warning if it sees missing (optional) png definitions for critical icon sizes.
E) I have made the manifest permanently cached. I want to option to set it to say a week?
Comment #112
martin107 CreditAttribution: martin107 as a volunteer commentedI have not work on my todo list from above, I got sidelined with other issues that arose.
I still plan to work on the todo list.
A) I have converted a kernel test to a unit test.. something I had better justify.
1) Debugging slow tests is painful. Tests that run in milliseconds rather than 5 mins make me happy.
2) The additional assurance the kernel test gave was proving the wiring of the service into core etc
are all duplicated. We have extensive functional testing for that.
B) ThemeSettingsForm had a bug in it. Color was not found.
+use Drupal\Component\Utility\Color;
C) Some optional field are pulled down from a list .. I looked at the spec and added missing values.
D) I add a "--Leave Empty --" pulled down optional so that a user can omit the field.
Comment #113
martin107 CreditAttribution: martin107 as a volunteer commentedCoding Standard fix up.
Comment #114
zenimagine CreditAttribution: zenimagine commentedHi, will this feature allow PUSH notification and offline content ? Thank you
Comment #115
martin107 CreditAttribution: martin107 as a volunteer commentedAll the test fails seem to have common error. so I fixed up Drupal\Tests\file\FunctionalJavascript\FileFieldWidgetTest
and testbot will tell me what is left.
@zenimagine
No, those are both big topics .. which we as community need to keep upto date with - just not here.
storing content offline is a massive topic..
In general all solutions of that type need to register a service worker with the browser .. JS code in the browser to act a network proxy .. code intercepting all network requests and providing faked network data from a local store when offline. All core can do there is provide hooks for site specific/ theme specific/ contrib module specific logic to make decisions about what to cache etc. ( by hooks I mean that very loosely in a class driven sense. )
I hope that makes sense.
When I look for further work after this issue. Adding 'content_scripts' to the manifest is a different large topic.
Comment #117
yogeshmpawarComment #118
yogeshmpawarUpdated patch with an interdiff.
Comment #119
martin107 CreditAttribution: martin107 as a volunteer commented@yogeshmpawar
Thanks for fixing my errors. - that was helpful
I think I might re-work your test changes a little. It is better to expected the test to return something unexpected something that one can't have come from a default hidden in the system.
In short, I want to set the expected return value to be 'llama'
I grabbing this back to signal that I am actively working on this.
I have a support for icons partially working .. nothing ready for show and tell yet.
Comment #120
martin107 CreditAttribution: martin107 as a volunteer commentedI added the first cut versions of icons support -- in the manifest file.
A) Added a table to ThemeSettingsForm -- each table row contains a fieldset holding a icon datablock.
B) The schema has been updated to hold a unlimited list of icon data
C) The icon section is now output in the manifest.json file.
I have work to do
D) The form needs 'delete' and 'add new icon' actions associated with the icon block.
E) The icons are cascaded so the table need to be draggable.
Comment #122
martin107 CreditAttribution: martin107 as a volunteer commentedI have split off the umami design decisions related to the mobile and desktop icons into a separate issue
So that the umami contributors can have their say.
From there perspective - we provide the mechanism, they the icons.
Comment #123
martin107 CreditAttribution: martin107 as a volunteer commentedWhile I think about it, whatever I set for the default bartik/core theme has branding implications -- which is a whole discussion to itself.
Comment #124
borisson_I agree, but this will make this patch need JS-based testing as well. I'm not sure if we need to do that already in this issue (that has been dragging for a while), or if we should do that in a followup.
Comment #125
martin107 CreditAttribution: martin107 as a volunteer commentedJust a reroll.
Comment #126
martin107 CreditAttribution: martin107 as a volunteer commentedI still have things on my todo list.....
But in this next patch
a) Add a AJAX "Add Icon" button which appends a blank icon data block onto what every the user has edited or has been pulled form config
b) The main buildForm() is already absurdly long. [ The style guide lines I like limit methods/function to approx 100 lines of code. ]
So I have hived off the icon stuff into a buildIconTable() method.
@borisson_
Regarding the contentious
E) The icons are cascaded so the table need to be draggable.
As this starts to look polished I will make a decision about how much to test.. and try and take in your concerns into account then .. and maybe cut out some code in favor of simpler testing.
Still on my todo list
I need to add a delete action foreach icon data block.
Comment #128
martin107 CreditAttribution: martin107 as a volunteer commentedIn this next patch I have added a delete button.
But I am finding trouble removing a bug.
I am going to describe it in detail just in case anyone reading this knows this a "known problem".
I think the mistake is that the form is being incorrectly cached somewhere-- so if anyone can tell me the pattern I am using in bad please let me know.
Adding and deleting works when one button is added then deleted.
BUT it does not work in general. if you live edit three icons and then delete the middle one it fails.
The step to reproduce.
a) Click on the AddIcon set the path to "a"
a) Click on the AddIcon set the path to "b"
a) Click on the AddIcon set the path to "c"
delete the "b" button and observe that the third Icon button "c" is incorrectly deleted.
Note to self - this outlines a test I need to add..
Comment #130
martin107 CreditAttribution: martin107 as a volunteer commentedThe problem above still exists, but in unrelated news this should reduce the error count.
Comment #132
martin107 CreditAttribution: martin107 as a volunteer commentedAgain this does not solve the main problem.
But looking at the generated manifest files....
The icon datastructure need to be coerced into an array. [done]
My code for omitting empty key values needed to descend into the icon block and omit values inside that.
Comment #134
martin107 CreditAttribution: martin107 as a volunteer commentedWhile altering the form
admin/config/system/site-information
I noticed that manifest key, value pairs were not updated ... added a cache tag...fixed.
Also fixed -- a minor coding standard. ( 80 chars overspill )
Comment #136
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation for Pfizer, Inc. commentedSo excited to see progress on this, great job!
I had a look at the remaining failing tests, easy fix, we were just missing part of the config we install on
core/modules/system/config/install/system.site.yml
Comment #138
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation for Pfizer, Inc. commentedDecided to give this another push, here is the upgrade path, and the upgrade path test The test actually identified a typo bug on
ManifestGenerator::doGenerateManifest()
so fixed that while I was at it.Also fixed the other issues with the failing
MigrateSystemConfigurationTest
tests.Comment #139
martin107 CreditAttribution: martin107 as a volunteer commented@Manuel Garcia
Thanks man, thanks for fixing the tests, in particular my idiot move to misspell manifest_version in just the wrong place
- given the blindness to my own bugs .. I would have been looking for that for a month on Sundays. --- thank you thank you.
The next change is to add a first draft version of the 'live editing of icon data blocks test'.
In short the current bug and what I outlined in #128
I am seeing problems with my container setup ... I think
I am getting cannot add cookies errors in my output ... I just want to see what testbot does with this new test
There were 3 errors:
Please see the TODO I have yet to define what the manifest should look like when only 'a' and 'c' are saved.
Comment #141
martin107 CreditAttribution: martin107 as a volunteer commented1) Fixed css selector for the 'Add Icon' button.
2) Fixed a few cut paste errors associated with '$asser_session'
3) Fix tab errors.
There will be a short pause while I sort out my local dev system.
Comment #143
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation for Pfizer, Inc. commentedHahah I totally know the feeling, you're very welcome :)
Took the liberty of cleaning up the new test, should hopefully at least run correctly now.
Comment #145
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation for Pfizer, Inc. commentedAnother try
Comment #147
martin107 CreditAttribution: martin107 as a volunteer commentedminor update
Comment #148
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation for Pfizer, Inc. commentedAs far as I know you cant do a CSS selector by attribute using two attributes, using just the value here which should be enough.
Comment #150
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation for Pfizer, Inc. commentedAsserting that the middle icon was removed.
Comment #151
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedHow about adding a
$strict = FALSE
argument (or$strict_leading_hash
) to the existingvalidateHex()
method?Should we type hint with
array
here?The deprecated message needs to be in this form:
@deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use ...
"Reuturn a icon .." -> "Returns an icon .." :)
"Array" -> "array"
Deletes an icon table row?
I think
@group system
would be more appropriate.Needs an empty line at the end of the file.
Unneeded changes :)
Why do need to add this method to a test class?
Comment #153
borisson_#151.1 I disagree, I think having another method is clearer and makes the code internal to the method also easier.
All the other remarks are things that should be changed.
Comment #154
martin107 CreditAttribution: martin107 as a volunteer commented@borisson_ thanks for all the comments .. I will address them later .. here is a fix to the tests - well sort of.
when I looked at the css standard what I as looking for was
input[name="form_build_id"][value="xyz"]
but I could not get it to work ... in the end I reworked the test and now we wait to the progress throbber to blink in and out of existence.
[ in short I copied code from ThrobberTest ]
@Manuel Garcia ...so I am starting from 147 stepping over some of your welcome attempts to fix the problem and but I changed direction once I got stability.
Here is my current issue.
Now the test demand that 'bbb' is deleted in the live edit -- and the test confirm it ...
This is super strange bbb is still not deleted when I manually test it.
I am not sure how test get the correct result of 'aaa', 'ccc' is there extra cache clear or something ?
Note: I only set the expected icons -- once I got testbot to locally report what what actually received.
$icons_expected = [
0 => ['src' => 'aaa'],
1 => ['src' => 'ccc'],
];
I am still trying to track this down.
Comment #155
martin107 CreditAttribution: martin107 as a volunteer commentedamateescu -- sorry I should have mentioned you above... thanks for the review.
regarding 151
1) I am have not opinion. -one way or the other. - so have taken no action
2) done
3) done
4) done
5) done
6) appendEmptyIcon, and deleteSelectedIcons imply the processing is done in the callback. Which was the intent on the first draft.
So I refactored two functions in to a common updatedIconTable()
7) yes good catch ... thanks.
8) done
9) done
10) done.
Comment #156
idebr CreditAttribution: idebr at iO commentedNote that these return type hints require PHP 7.1.x while Drupal 8 currently still supports PHP 7.0.x. How these return values should be type hinted is under discussion in #3050720: [Meta] Implement strict typing in existing code. It appears we can start using these starting in PHP 7.2 if I understood correctly.
Comment #157
martin107 CreditAttribution: martin107 as a volunteer commenteda) From looking around the web there are lots of PHP 7.0.x tutorials talking about adding the new return type . I have only added a return type to new code not existing interfaces/classes so many of the objections raised in that issue do necessarily apply. But I don't want to hold this issue up anymore than needed it is too hot to argue so I will take it out in the next iteration.
b) I got bored of having to remember to swap the word order when jumping between ThemeSettingsForm to ThemeFormSettingsTest.
The natural convention is to just add 'Test' to the class name
So I created a spin off quick fix issue.
#3069553: Standardise name 'ThemeFormSettingsTest'
c) I want to make a comment in relation to the 'Needs UX review' tag
Intellectually - I appreciate why things have been done
But stand behind a fresh developer and watch his/hers first 20 minutes grappling with the new features.
Watch them discover the 2 forms
admin/config/system/site-information
admin/appearance/settings/bartik
And the reaction will be
'OMG: Why is Drupal getting in my way way.
When I want to to edit the manifest settings I want all the things in one place'
Comment #158
martin107 CreditAttribution: martin107 as a volunteer commentedReroll 'cos
#3069553: Standardise name 'ThemeFormSettingsTest'
Comment #159
martin107 CreditAttribution: martin107 as a volunteer commentedreroll - caused by
#3039026: Deprecate file_directory_temp() and move to FileSystem service
our new code has to share space in
function system_update_8801() {}
Comment #160
BerdirIt shouldn't be merged, it should be moved to a new update number. Each thing should have its own update function. While dev versions are a grey area as we don't support updating yet, the general rule is to never add to an existing update function, or sites that already executed this are left out.
Comment #161
martin107 CreditAttribution: martin107 as a volunteer commentedThanks Bedir, for pointing out my mistake.
Sorry for the slow pace on this issue... I need to sit down on a free weekend with xdebug and step through it.
I have a slight idea on what could be going wrong
As the test runs - the icon data block is never 'aaa', 'bbb' so we can't be inadvertently pulling from cache.
What must be happening is that
1) After the buildForm() has deleted the appropriate mid icon block
2) The ajax callback has run
3) -- then after what is broken is the form_state is being used to further rebuild/re-populate and push 'aaa', 'bbb' into the compacted form before being pushed out the door.
Comment #162
martin107 CreditAttribution: martin107 as a volunteer commentedStep through the problem with a debugger ...
Bedir had the solution to my problem in Nov 2016
https://drupal.stackexchange.com/questions/220185/clear-form-fields-afte...
Bedir++
The solution: Adjust the user input -- to prevent the rebuild re-imposing stale input.
Comment #163
martin107 CreditAttribution: martin107 as a volunteer commentedWhen I manually test this ... all is good
It is the test which is off.
I have not affected that...here
I have simplified the delete code.
Comment #165
martin107 CreditAttribution: martin107 as a volunteer commentedReroll.
Comment #166
martin107 CreditAttribution: martin107 as a volunteer commentedRemoved stray alteration to composer.json, composer.lock
Comment #168
martin107 CreditAttribution: martin107 as a volunteer commentedRegarding 122
#3064299: Umami: Mobile/Desktop Icon Design
and the response is in effect "let us go with the drupal defaults"
Comment #170
xjmComment #172
nod_Reroll, hope i didn't break too many things. There were changes in some weird places so removed them.
I don't remember/know why we have a "version" field in the manifest, might need to get rid of it.
We should add support for a few things in the manifest:
https://w3c.github.io/manifest/#dom-webappmanifest-shortcuts
https://w3c.github.io/manifest/#related_applications-member
There is already an alter hook to modify the content of the manifest file, so it's definitely doable in contrib at least.
Comment #173
nod_didn't have the new files
Comment #175
raman.b CreditAttribution: raman.b at OpenSense Labs commentedRequired another re-roll after 3055193
Also addressing the failed tests from #173
Comment #177
raman.b CreditAttribution: raman.b at OpenSense Labs commentedComment #178
mikemiles86I have a project currently running 8.9.x which needs this functionality and is not yet ready to move to 9.1.x. I re-rolled the #177 patch for 8.9.x.
Comment #179
heddnLooks like needs another re-roll. There are PHP linting issues in modules/system/tests/src/FunctionalJavascript/ThemeSettingsFormTest.php
Comment #180
munish.kumar CreditAttribution: munish.kumar as a volunteer and at Srijan | A Material+ Company for Drupal India Association commentedReroll #178 for 8.9x branch
Comment #181
nod_Please keep patches for 9.1.x the feature will not be introduced in drupal 8.
If you need the manifest install the pwa module.
Comment #182
nod_Patch to look at is #177
Comment #185
viappidu CreditAttribution: viappidu as a volunteer commentedRefactored 9.3.x
Comment #186
viappidu CreditAttribution: viappidu as a volunteer commentedFound problems in previous patch. Not sure what I did wrong...
Comment #187
SpokjeNot quite sure what's going on with all the patches after #177, please use interdiffs.
So let's start with a straight-up re-roll from #177 against
9.3.x
.Comment #188
SpokjeUsed
2698127-187.patch
as base for the new MR.Comment #190
SpokjeComment #191
SpokjeComment #192
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer commentedRevisiting the accessibility concerns in #91-94.
I'd like to remove the orientation property from the scope of this issue entirely.
Offering site-builders a way to specify the orientation property in a manifest amounts to thermo-nuclear option. "Use this setting if you want to fail WCAG with 99.9% certainty".
Re. #94:
This isn't the case. In practice, it amounts to an outright lock when the PWA is installed. Users of the PWA don't have a choice in this at all.
If you visit a website using an Android browser, then install the PWA, the orientation will be locked whenever you use the PWA. If the web site has a PWA manifest, users lose the option to "save to home screen" as a mere bookmark; they can only install the PWA.
No. The only acceptable value is
"orientation": "any"
, but there's no point providing a UI with only one option. Theorientation
key isn't mandatory in a PWA manifest, so let's omit it entirely.i.e. Orientation won't be offered in the settings form, and the property won't be present in the
manifest.json
which is served.The PWA contrib module issue discusses this in detail - #3070058: Document how to specify the orientation parameter via alter hook.
Here's why I think it should be removed:
"orientation": "any"
. If we let a site owner set the orientation, then they will. Their visitors will not be able to override this.The
hook_manifest_alter()
API provides a mechanism to add the orientation property, for sites which genuinely qualify for the WCAG SC 1.3.4 essential-orientation exception.Proposed resolution:
manifest.json
entirely, or hard-code it to "any".Comment #193
nod_I might be missing something but how does that work with the alter hook supposed to let people modify the values of the manifest?
That should probably be additional, as in take the theme settings and merge with the system theme global values.
We should do data processing/formatting on output not input. let's add a method to ManifestGenerator that makes sure there is a # for color values. no need to duplicate a validation method
this is not necessary. it's from the pwa module but it's not part of the spec.
as said above, let's get rid of this.
I'd remove that from the initial patch, let's declare that in themes as examples but I'm not sold on providing a generic user-input for this.
I'd say that if a theme wants to make icons configurable it's their responsibility. Like the color module integration.
Comment #194
AaronMcHaleI'd just like to jump in to second the points that @andrewmacpherson made in #192.
As a visually impaired web user myself, I feel strongly that sites shouldn't restrict the users' ability to do things like pinch-zoom and control the orientation. Far too often I come across "mobile" sites that are less accessible for me simply because the developer has made the choice to restrict the ability to pinch-zoom.
I would be grateful if Drupal could avoid contributing to this problem generally.
Thanks,
-Aaron
Comment #195
xmacinfoI did not read the whole issue But the last few comments about accessibility hit the point.
I am against any binding from a manifest file to Drupal that will prevent:
I would prefer that Drupal never generates a manifest file, or if a manifest file exist, that Drupal does not change basic usability/accessibility behaviours based on that file.
Accessibility/usability comes foremost. Don't lock users out.
If Drupal ends implementing a manifest.json, Drupal should also allow any user to disable it entirely.
Comment #197
MacSim CreditAttribution: MacSim at Spiriit commentedI am sorry but I am not following you on the orientation change ; most of the natives apps are locked in the portrait orientation.
I am not telling that it's always a good idea ; it's a fact that people in a wheelchair with a non-rotating mobile/tablet support will feel like these apps are not accessible. But, depending on the PWA you're building, you might choose to ignore that person in their wheelchair, not because you're mean or haven't thought of it, but because your PWA isn't aimed at this type of person - their disability preventing him/her from doing the activity covered by your PWA.
It's up to the developers and UI / UX designers to create an accessible interface regardless of whether the orientation is locked or not. IMHO Drupal shouldn't go against the manifest specs. If an option is available in the specs and supported by most browsers, even if not mandatory, it should be configurable.
If you don't want to lock the orientation change, you would choose the "any" option (which should be the default option since it will be the case in 90% of the WPAs) but if - for some reason - you want to lock the orientation, Drupal should provide the means to do so.
Comment #201
mgiffordComment #202
AnybodyComment #203
dercheffeAs a disabled person I agree with that 👍. Going with the standards/specs of technology is almost a good option. Don't forget that accessibility often plays together with different third party apps. The assistance software (braille device etc.) is more comfy with standards. And in my opinion it might be a kind of exclusion too, to "hard code" an option independent from it's direction. Let the developers/designers decide what is necessary for the individual use case.
Comment #204
xmacinfoWe can remove “orientation change” from the list I made.
But there is no clear consensus on that one. See #194 and #192.
Creating a good-looking and usable web page/web app in both orientations requires more work. But using responsive CSS code helps to build pages that adapt to most screen sizes.
Personally, on an iPad, for example, I want to be able to use a web page/web app in any orientation and not be left lock-out in one orientation.
Comment #205
tyler36 CreditAttribution: tyler36 at Inter Quest commentedFrom #197
> If an option is available in the specs and supported by most browsers, even if not mandatory, it should be configurable.
This. However, "orientation" is marked as "Experimental: Expect behavior to change in the future." so I would be inclined to skip this (and any other experimental) to increase reliablity.
Currently, patch #187 and the MR reference the "color" module which was removed in Drupal 10.
Comment #206
Albert Volkman CreditAttribution: Albert Volkman commentedCreated a version of the existing patch to apply to 10.1.x