fix(room): make the members-panel filter work and stop the self-row 404 (LC-689) #658
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/LC-689-members-filter"
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?
Two bugs in the LC-683 room members panel (opened from the header avatar cluster).
1. The filter did nothing
The inline
oninputsetrow.hidden = trueon non-matching rows, but each row is<a class="lc-member-row flex …">, and Tailwind's.flex { display: flex }(author) beats[hidden] { display: none }(UA) regardless of specificity - sohiddenwas inert and every row stayed visible. Same cascade trap as LC-678 / LC-686.Fix: toggle
style.display('none'/'') instead of thehiddenattribute - an inline style beats the class, and clearing it restores the.flexdisplay. Filtering stays client-side over the rendered rows (bounded rooms, no round-trip).2. Clicking your own row 404'd
Every row is a DM deep-link (
href=/dm/{user_id}), so your own row pointed at/dm/{your-id}→ 404 (you can't DM yourself). The viewer's own row now renders without a DM href (and without the hovercard) and is marked "You", so it doesn't navigate. An<a>with no href is valid and non-navigating, so self and non-self rows share one element; everyone else keeps the DM link + hovercard. Addsis_selftoMemberRowand amembers-youstring (en + es).Tests
Full lib suite (317, incl. members unit tests + i18n en/es parity).
cargo fmt+clippyclean. No new CSS classes.🤖 Generated with Claude Code
https://claude.ai/code/session_01PBAyCesyqJkZ5JgixXf9Lf
Two bugs in the LC-683 room members panel. 1. The filter did nothing. The inline oninput set `row.hidden = true` on non-matching rows, but each row is `<a class="lc-member-row flex ...">`, and Tailwind's `.flex { display: flex }` (author stylesheet) beats `[hidden] { display: none }` (UA stylesheet) regardless of specificity - so the hidden attribute was inert and every row stayed visible. Same cascade trap as LC-678 / LC-686. Fixed by toggling style.display ('none' / '') instead of the hidden attribute; an inline style beats the class, and clearing it restores the flex display. 2. Clicking your own row 404'd. Every row is a DM deep-link (href=/dm/{user_id}), so your own row pointed at /dm/{your-id}, which 404s because you cannot DM yourself. The viewer's own row now renders without a DM href (and without the profile hovercard) and is marked "You", so it simply does not navigate. An <a> with no href is valid and non-navigating, so self and non-self rows still share one element; everyone else keeps the DM link + hovercard. Adds is_self to MemberRow and a members-you string (en + es). Full lib suite (317, incl. the members unit tests + i18n en/es parity); fmt + clippy clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PBAyCesyqJkZ5JgixXf9Lf