Monorepo for Tangled tangled.org

proposal: share button on comments #4873

Open nkmason.dev
Open opened by nkmason.dev

Currently the relative time (TimeAgo component) is treated as the share button.

Image

This is a very ambiguous behavior and I'd like to propose that we add a share button in the hover-able comment actions div. Something like

export const shareHref = (rkey: string, current: string): string => {
	const url = new URL(current);
	url.hash = `#comment-${rkey}`;
	return url.toString();
};

...

<CopyButton
	value={() => shareHref(comment.rkey, location.href)}
	feedback="icon"
	variant="ghost"
	size="small"
	icon={Share}
	label="Share"
	title="Copy a link to this comment"
	class="hit-area-x-0.5 overflow-visible"
/>

When a user lands on the shared link (with comment anchor) that comment should be auto scrolled to and flashed to let the user know what comment was shared.

Same should be applied to PullReviewComment component as well.

Something like this

Image

a link icon might work better here i think! good idea, thanks 😃

Yea makes sense. Can I take this issue up?

Go right ahead!

Sign up or Sign in to add to the discussion.