fix(package): render a multi-valued facet as separate values - #5
Merged
Conversation
A facet is multi-valued by contract -- build.py filters with
`str(value).split()` -- but the package page printed the raw value, so a
two-value facet came out as one blob:
category tui web-ui
which reads as a single odd token rather than two values. Filtering and display
now split the same way, and each value renders as its own chip, matching how
platforms already render.
Adds a `split_facet` filter rather than splitting inline, so the contract lives
in one place next to `platform_label`.
The test asserts the rendered values, not the string: it builds a throwaway
index whose plugin sets a two-value and a one-value facet, then checks the
package page emits exactly ["tui", "web-ui"] and ["solo"], plus that the joined
form never appears anywhere on the page. Reverting the template fails all three.
Sunrisepeak
added a commit
to Sunrisepeak/dsh-index
that referenced
this pull request
Aug 13, 2026
…ackages Follow-up to #1, driven by installing from the live index rather than reading the code. Plugins now land in a profile the user can find. The subos branch was dead code: it read XLINGS_SUBOS, which xlings does not set, so "the profile follows the subos" was documented but never true and every install silently landed in `web`. It now comes from system.subos_sysrootdir(), a libxpkg API rather than an ambient variable. Surface plugins (tui, desktop) get a profile named after themselves, matching what upstream's own docs tell users to run, and config() prints the profile and the launch command -- the obvious guess was the command upstream documents, and it failed. The index drops from 168 descriptors to 68. 51 that nobody can install and 70 with fewer than two stars, overlapping. Broken is measured, not inferred: the mirror pipeline refuses what it cannot build, and the causes break the direct path too -- dependencies that do not resolve or do not exist, and TypeScript packages whose `main` is absent from their own tarball. The 30 that were broken AND had two or more stars were re-verified one at a time before deleting; all 30 reproduced. Removal is data in tools/excluded.json with the reason attached, read by gen_descriptors.py, because deleting a file alone would be undone by the next regenerate. Packages whose license cannot be identified are kept. They install fine; they just cannot be mirrored, since mirroring is redistribution. They are labelled `unknown`, following GitHub's own convention rather than the API's NONE sentinel. 41 survivors carry a mirror block backfilled from releases published to both GitHub and GitCode, each verified three ways at publish time. Facet values rendered as Python reprs, so `['web-ui',` and `'session']` became separate buttons: pkg.facets is Dict[str, str] and the core splits multi-valued facets on whitespace. The other half of that bug is fixed upstream in openxlings/xpkgindex#5. README follows mcpp's shape now, and .agents/docs carries a work log for the whole integration. Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
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.
The bug
A facet is multi-valued by contract —
build.pyfilters withstr(pkg.facets.get(facet.key) or "").split(). Butpackage.htmlprinted theraw value, so a two-value facet rendered as one blob:
tui web-uireads as a single odd token, not two values. The filter row on thehome page splits correctly; only the detail page did not.
Fix
Split at display the same way it is split at filter time, and render each value
as a chip — the markup platforms already use.
Added as a
split_facetfilter rather than an inline.split(), so thecontract sits in one place next to
platform_label.Test
tests/test_facet_display.pybuilds a throwaway index whose plugin sets onetwo-value facet and one single-value facet, then asserts on the rendered
values, not on a string:
kindemits exactly["tui", "web-ui"]singleemits exactly["solo"](single-valued behaviour unchanged)tui web-uiappears nowhere on the pageReverting the template fails all three.
Full suite:
45 passed.Where it showed up
Sunrisepeak/dsh-index, whose plugin setscategoryandkeywordfrom eachplugin's own topics — those are naturally multi-valued.