Repository: All-Hands-AI/OpenHands
File: frontend/src/components/features/conversation/conversation-name-context-menu.tsx (TypeScript)

Code before:
        >
          <ConversationNameContextMenuIconText
            icon={<CreditCardIcon width={16} height={16} />}
            text={t(I18nKey.BUTTON$DISPLAY_COST)}
            className={CONTEXT_MENU_ICON_TEXT_CLASSNAME}
          />
        </ContextMenuListItem>
      )}

      {shouldShowPublicSharing && (
        <ContextMenuListItem
          testId="share-publicly-button"
          onClick={onTogglePublic}
          className={contextMenuListItemClassName}
        >
          <div className="flex items-center gap-2 justify-between w-full">
            <div className="flex items-center gap-2">
              <input
                type="checkbox"
                checked={conversation?.public || false}
                className="w-4 h-4 ml-2"
              />
              <span>{t(I18nKey.CONVERSATION$SHARE_PUBLICLY)}</span>
            </div>
            {conversation?.public && shareUrl && (
              <a
                data-testid="open-share-link-button"
                href={shareUrl}
                target="_blank"
                rel="noopener noreferrer"
                onClick={(e) => e.stopPropagation()}
                className="p-1 hover:bg-[#717888] rounded"
                title={t(I18nKey.BUTTON$OPEN_IN_NEW_TAB)}
              >
                <LinkIcon width={16} height={16} />
              </a>
            )}
          </div>
        </ContextMenuListItem>
      )}

      {onStop && (
        <ContextMenuListItem
          testId="stop-button"
          onClick={onStop}
          className={contextMenuListItemClassName}
        >
          <ConversationNameContextMenuIconText
            icon={<CloseIcon width={16} height={16} />}
            text={t(I18nKey.COMMON$CLOSE_CONVERSATION_STOP_RUNTIME)}
            className={CONTEXT_MENU_ICON_TEXT_CLASSNAME}

Review comment (suggestion):
**question:** In the past, if I wanted to copy a conversation link to share with my teammates, I could simply click this button.

Now, it seems I need to open the shared link in a new tab and then copy it from the browser.

Would it be possible to keep both options—one button to copy the shared link directly, and another to open it in a new tab? I think having both would make sharing more convenient.

Thank you! 🙏 

Code after:
          testId="display-cost-button"
          onClick={onDisplayCost}
          className={contextMenuListItemClassName}
        >
          <ConversationNameContextMenuIconText
            icon={<CreditCardIcon width={16} height={16} />}
            text={t(I18nKey.BUTTON$DISPLAY_COST)}
            className={CONTEXT_MENU_ICON_TEXT_CLASSNAME}
          />
        </ContextMenuListItem>
      )}

      {shouldShowPublicSharing && (
        <ContextMenuListItem
          testId="share-publicly-button"
          onClick={onTogglePublic}
          className={contextMenuListItemClassName}
        >
          <div className="flex items-center gap-2 justify-between w-full hover:bg-[#5C5D62] rounded h-[30px]">
            <div className="flex items-center gap-2">
              <input
                type="checkbox"
                checked={conversation?.public || false}
                className="w-4 h-4 ml-2 cursor-pointer"
              />
              <span>{t(I18nKey.CONVERSATION$SHARE_PUBLICLY)}</span>
            </div>
            {conversation?.public && shareUrl && onCopyShareLink && (
              <div className="flex items-center gap-1">
                <button
                  type="button"
                  data-testid="copy-share-link-button"
                  onClick={onCopyShareLink}
                  className="p-1 hover:bg-[#717888] rounded cursor-pointer"
                  title={t(I18nKey.BUTTON$COPY_TO_CLIPBOARD)}
                >
                  <CopyIcon width={16} height={16} />
                </button>
                <a
                  data-testid="open-share-link-button"
                  href={shareUrl}
                  target="_blank"
                  rel="noopener noreferrer"
                  onClick={(e) => e.stopPropagation()}
                  className="p-1 hover:bg-[#717888] rounded cursor-pointer"
                  title={t(I18nKey.BUTTON$OPEN_IN_NEW_TAB)}
                >
                  <LinkIcon width={16} height={16} />
                </a>
              </div>
            )}