Fix #410: VisSelect render path #412
No reviewers
Labels
No labels
actions
bug
cli
duplicate
enhancement
fork
forum
git storage
help wanted
insights
invalid
issues
moderation
oidc
ownership transfer
packages
pr/merge protection rules
projects
pull requests
question
releases
sponsorships
tags
webhooks
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub!412
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/issue-410"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #410 — the profile visibility selector rendered nothing through an opaque render path.
Research (research-first, hypotheses validated with evidence)
Against the pinned
solid-js@1.9.15sources inweb/node_modules:<For>children mapper is invoked per item asmapFn(item)(clientmapArray'smapper, arity-1 like ours) orfn(item, () => i)(SSRsimpleMap) — the index arrives as an accessor function, never a raw number, and the item is the option object, nevero.label. A hand-rolled adapter callingchildren(item, i)/children(o.label)mismatches both real paths.mapArrayreadslist() || [], so an undefinedeachrenders nothing — the observedCannot read properties of undefined (reading 'value')comes from invoking the mapper with an undefined ITEM, which the real path never does with a populatedeach./_ui/assets/*.js(verified: bundled, no external runtime import). The 404 was a harness artifact of bypassing the vite build — plain node has no JSX transform, so.jsxcannot even be imported (that unimportability IS the opaque path).visibilityOptions()built fresh arrays/objects per call;<For>diffs by===identity, so every owner-kind refire rebuilt all<option>nodes and the select fell back topublic. Now hoisted frozen constants.Full write-up in
docs/features/01_identity_permissions.mdDecisions (#410 entry, law 12).What changed
web/src/components/VisSelect.jsx(new): the one shared selector — real<For each={visibilityOptions(props.isOrg)}>path, arity-1(o)mapper,value={props.value ?? ''}keeps the #394 blank-while-unseeded rule.web/src/pages/Settings.jsx+web/src/pages/Access.jsx: inline selects replaced with<VisSelect>(Access gainsaria-label="Visibility").web/src/lib/visibility.js:visibilityOptions()returns hoisted frozen constants (deep-equal shape unchanged).web/src/lib/visSelect.js(new): headless row model (visRows— exactly the current rowselected, none for unknown/empty).web/test/unit/vis-select.test.js(new): the live-render rig — the REALForfromsolid-js(no adapter stubs) rendering populated rows and observing the selected mark followpublic → private → authenticatedplus the user→org relabel; H1/H2 shapes pinned; static guards that the component stays on the real path.Verification
node --test web/test/unit/*.test.js: 816/818 (the 2 fails aresmoke.test.jsneeding a live server — a foreign process answers :8080 in this env; identical failures on pristine main, pre-existing/environmental).vite buildclean (593 kB bundle, options verified inside); no new deps (package.jsonuntouched);gofmtclean (no Go changes).For(see rig). A real-Chromium pass on/, a repo settings page, and/setupis still wanted on review hardware.