Skip to content

Conversation

@allison-truhlar
Copy link
Collaborator

@allison-truhlar allison-truhlar commented Nov 19, 2025

Clickup id: 86aceaxy3

This PR makes the values in the data links and task tables copy-able in two ways:

  1. Click on the text in a cell (with the exception of the linked paths) to automatically select the entire text. Then use Crtl + C to copy.
  2. Right click in any cell and select "copy" from the context menu.

In the process of making this change, I refactored the copy tooltip logic to a hook and made a CopyTooltip reusable component (I had originally thought I would go the "click to copy" route, and use the tooltip to indicate the text had been copied). I also refactored the context menu from the FileBrowser to make it reusable for the tables.

@krokicki

Copy link
Member

@neomorphic neomorphic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code works and the UI looks good to me. I left a couple of comments about the useContextMenu.


// Context menu state
const {
contextMenuCoords,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you importing the contextMenuCoords here, only to pass them on to the ContextMenu component. Couldn't you have the const {contextMenuCoords} = useContextMenu<CellContextMenuData>(); call in the ContextMenu component? What am I missing?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've found when working with hooks if there is state that is operated on by functions also exposed by the hook, the behavior gets weird if you don't create the state and function together in one component and pass them down together, if needed. So specifically for the showContextMenu state, if I create fresh state in the ContextMenu by calling the hook again, the close function is not operating on the showContextMenu state in TableCard, so the context menu stays visible.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

contextData,
menuRef,
openContextMenu,
closeContextMenu
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question here. Why is this being imported here and not in the ContextMenu component?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above response

@allison-truhlar allison-truhlar merged commit 80f6f33 into main Nov 21, 2025
7 checks passed
@allison-truhlar allison-truhlar deleted the make-table-values-copyable branch November 21, 2025 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants