501: modify TextArea for user tags#506
Conversation
|
Broken link href in return <span key={...} className="tag">{value}</span>;
export function renderHighlightedText(value: string) { ... }Variable shadowing const renderHighlightedText = (value: string) => {
const parts = value.split(...);
return parts.map((value, idx) => { // ← shadows outer `value`Rename the inner param to
Fixed height regresses UX min-height: 112px;
max-height: 300px;
overflow-y: auto;No focus indicator on |
nadavosa
left a comment
There was a problem hiding this comment.
The overlay scroll-sync technique is the right approach for this kind of rich-text highlight. A few things need to be resolved before merging:
Blocking:
-
All three TODOs are unresolved and the links are broken. Every
@mentioncurrently navigates to the literal string/volunteers/:userId. Clicking a tag will land on a 404. This needs to be either wired up to a real user lookup, or theLinkreplaced with a plain styled span until the lookup is implemented. -
CSS typo:
user-selects: noneinTagOverlayshould beuser-select: none(no trailings). As written the rule has no effect — the overlay will intercept pointer events even thoughpointer-events: nonehandles the main case.
Minor:
-
Removing
resize: verticalon the textarea and fixing height to112pxis a UX regression compared to the originalmin-height: 112pxwith vertical resize. Consider keepingresize: nonebut usingmin-heightso longer comments are not cut off. -
aspect-ratio: 4/1onAddCommentButtonwill break at narrow viewport widths — the button will shrink. A fixedmin-widthwould be safer.
nadavosa
left a comment
There was a problem hiding this comment.
Hey @DarrellRoberts — you mentioned the issues from my last review were fixed in PR #537. Looking at this PR's diff directly, a few things are still unresolved here:
Still open in this PR:
-
Broken link
href="/volunteers/:userId"inhooks/useCommentTag.tsx—:userIdis a literal string, not an interpolated value. Every@mentionin a displayed comment navigates to a 404. PR #537's version ofuseCommentTagreplaces this with a<span>, which is the right call until user-ID resolution is wired up. This PR needs the same fix or should be superseded by #537. -
user-selects: noneCSS typo instyles.tsTagOverlay— the property isuser-select(no trailings). This PR'sstyles.tsstill has the misspelled version. PR #537 hasuser-select: none(correct). -
Fixed
height: 112pxonNewCommentSection— raised in my last review; still unchanged here. -
No
:focus-withinonNewCommentSection— accessibility regression still present.
Suggestion on merge order: PR #537 supersedes useCommentTag and the styles — if #537 is ready first, this PR may need a rebase/update to avoid conflicts and to pick up the correct versions. Worth coordinating.
Description
Changes TextArea so that it accepts user tags with
@character as well as display comments, so that tags look different from usual textRelated Issues
Closes #501
Changes
Screenshots / Demos
Checklist