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

matrix: improve maintainability of Matrix icons #142

Open
4 tasks
SigmaSquadron opened this issue Dec 9, 2024 · 0 comments
Open
4 tasks

matrix: improve maintainability of Matrix icons #142

SigmaSquadron opened this issue Dec 9, 2024 · 0 comments

Comments

@SigmaSquadron
Copy link
Contributor

SigmaSquadron commented Dec 9, 2024

Problem

Since Samuel left NixOS, we were left with a massive SVG file that sort of still works but is hard to work with and can break at any moment.

There are plenty of PRs adding new icons to that SVG, but they either have merge conflicts or will have merge conflicts once another icon is merged. This has already happened when #130 was merged, causing a conflict in #137.

Proposed Solution

Redesign the whole icon generator.

Lessons learned:

  • Use separate, small SVG files for each channel.
    • These can be optimised individually, significantly reducing the total directory size.
  • Have documentation available for how to create new icons that follow a cohesive style guide.
  • Don't pin a Nixpkgs revision, otherwise it'll never be unpinned again and will break as soon as something is deprecated in Nix (i.e. URL literals)
    • We can ensure that the icons stay consistent by having CI build and display the icons in a PR that adds new icons, or build and check the icon hashes for PRs that update the flake.lock in the matrix/ directory.
      • I am hoping that converting SVG to PNG is deterministic.

What next?

  • Split the main SVG into separate files — one for each channel.
  • Write simple, extensible derivations that simply convert the files into PNGs.
    • A simple flake is perfect for this, IMO.
    • We can leverage lib.filesystem.listFilesRecursive to allow new icons to be created without any Nix knowledge.
  • Based on the output of those derivations, we can write CI checks and use GitHub apps to display them in a PR's thread.
  • Also write an action to automatically update the flake every few days.

Naturally, I am volunteering to maintain the matrix icon tree. This issue is for community input, as well as an invite for anyone who would like to help.

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

No branches or pull requests

1 participant