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

Intelligent Icon creator command #107

Open
Spomky opened this issue Mar 6, 2024 · 4 comments
Open

Intelligent Icon creator command #107

Spomky opened this issue Mar 6, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Spomky
Copy link
Member

Spomky commented Mar 6, 2024

Description

As per discussion here: #100 (reply in thread)

Example

No response

@Spomky Spomky added the enhancement New feature or request label Mar 6, 2024
@Spomky Spomky added this to the 1.2.0 milestone Mar 6, 2024
@Spomky Spomky self-assigned this Mar 6, 2024
@Spomky
Copy link
Member Author

Spomky commented Apr 3, 2024

Icon mgmt is a bit boring....
The user shall:

  • Use the command to generate icons at the correct size
  • Copy / Paste the output and indent correctly in the correct section

Repeat for the application or each shortcut.

# Configuration (today)
pwa:
    manifest:
        ...
        icons:
            - src: "icons/logo.svg"
              sizes: [0]
            - src: "icons/logo_48x48.png"
              sizes: [48]
            - src: "icons/logo_96x96.png"
              sizes: [96]
            - src: "icons/logo_144x144.png"
              sizes: [144]
            - src: "icons/logo_180x180.png"
              sizes: [180]
            - src: "icons/logo_256x256.png"
              sizes: [256]
            - src: "icons/logo_512x512.png"
              sizes: [512]

This could be drastically simplified by formatting/converting the files during the compilation time

# Expected configuration
pwa:
    manifest:
        ...
        icons:
            - src: "icons/logo.svg"
              formats:
                  # Tuples format: sizes
                  svg: [0]
                  png: [48, 96, 144, 180, 256, 512]

During the compilation, the bundle should:

  • Create the icons at the expected sizes and formats
  • Populate the manifest accordingly

For dev/test, the images are not converted and formats are merged.
The browser will moan about that in these envs, but not in production.

When done, this will be on a similar way for #66

@tacman
Copy link
Contributor

tacman commented Apr 3, 2024

Great idea.

I was also playing around with generating screenshots as a separate yaml file and importing it in the main pwa.yaml. That is

# pwa.yaml

imports:
    - screenshots.yaml

Then the screenshots.yaml file can be independently maintained. I've been playing around with a screenshot generator using zenstruck/browser, because it handles the authentication so easily. The screen size options are still a bit clunky, though.

@Spomky
Copy link
Member Author

Spomky commented Apr 3, 2024

I think we could get rid of symfony/panther or zenstruck/browser by using screen capture API. From the profiler footes bur (maybe?).

@tacman
Copy link
Contributor

tacman commented Apr 3, 2024

Hmm, interesting. I'm not familiar with how to use that, especially from the command line.

I like the idea of having a utility that automates the screen captures into a script.

@Spomky Spomky modified the milestones: 1.2.0, 2.0.0 Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants