Optimize MDI metadata file (88% smaller) and add weekly optimizer workflow#28
Draft
Copilot wants to merge 1 commit into
Draft
Optimize MDI metadata file (88% smaller) and add weekly optimizer workflow#28Copilot wants to merge 1 commit into
Copilot wants to merge 1 commit into
Conversation
Agent-Logs-Url: https://github.com/Misiu/OpenDisplay_HA_Integration/sessions/bff8cf5f-f3e6-4adf-b264-42974fb9528f Co-authored-by: Misiu <1741838+Misiu@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
Misiu
April 28, 2026 10:31
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports the MDI metadata optimization from
argon_industria_oled. The originalmaterialdesignicons-webfont_meta.json(~3.16 MB) carried per-icon UUIDs, tags, authors, versions and empty alias arrays — none of which are used at render time. Flattening to aname/alias → codepointmap shrinks it to ~354 KB (88.8%) and replaces the O(n) scans inicons.pywith a single dict lookup.Changes
scripts/optimize_materialdesignicons_meta.py— flattens the metadata, sorted, written compact (no whitespace). Idempotent on already-optimized input so the workflow is safe to re-run.materialdesignicons-webfont.meta.json— new optimized asset; oldmaterialdesignicons-webfont_meta.jsonremoved. New file name per the problem statement.custom_components/opendisplay/imagegen/icons.py—draw_iconanddraw_icon_sequencenow domdi_data.get(icon_name)against the flat dict. The old list-of-objects format is no longer supported (no backward-compat path requested)..github/workflows/optimize-mdi-metadata.yaml— weekly (Mon 00:00 UTC) +workflow_dispatch. Runs the optimizer, and if the file changed, closes any prior automated PR for the same base branch and opens a new one with before/after size stats. Branch name is sanitized for refs containing/.Lookup before/after