Skip to content

refactor(ui): type registry dispatch in templates.rs (completes #369) - #967

Merged
ertime037 merged 1 commit into
mainfrom
feat/369-ui-templates
Sep 6, 2026
Merged

refactor(ui): type registry dispatch in templates.rs (completes #369)#967
ertime037 merged 1 commit into
mainfrom
feat/369-ui-templates

Conversation

@devitway

@devitway devitway commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Completes #369. The UI templates were the last stringly-typed registry-dispatch sites — render_package_detail, render_registry_list_paginated, and the get_registry_icon / get_registry_title helpers all matched on registry_type: &str string literals.

This parses once to RegistryType and matches on the enum. The icon/title helpers become exhaustive matches, so adding a registry variant is now a compile error there too (the consumer-side complement of the enum being the single source of truth).

No behavioral change: mount points, install commands, icons, and titles are identical.

Tests

Full suite green (1798 unit + doctests); the ui::templates render tests pass unchanged. The type-safety ratchet drops from 53 to 0 string-dispatch sites.

Completes #369. The UI templates were the last string-dispatch sites: render_package_detail, render_registry_list_paginated, and get_registry_icon / get_registry_title matched on registry_type string literals. Parse once to RegistryType and match on the enum (icon/title become exhaustive matches — a new variant is now a compile error there too). No behavioral change: mount points, install commands, icons and titles are identical. The type-safety ratchet drops from 53 to 0 string-dispatch sites.
@devitway
devitway requested a review from ertime037 as a code owner September 6, 2026 09:58
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

🐳 Test image pushed: ghcr.io/getnora-io/nora:pr-967

docker pull ghcr.io/getnora-io/nora:pr-967
docker run --rm -p 4000:4000 ghcr.io/getnora-io/nora:pr-967

@ertime037
ertime037 added this pull request to the merge queue Sep 6, 2026
Merged via the queue into main with commit f9a745a Sep 6, 2026
20 checks passed
@ertime037
ertime037 deleted the feat/369-ui-templates branch September 6, 2026 10:17
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.

2 participants