feat: Add tooltip for paperclip attach button when no files are parsed (#5139)

* fix broken tooltip

* fix tooltip not showing on homepage

* fix tooltip rendering behind input on homepage

---------

Co-authored-by: shatfield4 <seanhatfield5@gmail.com>
This commit is contained in:
Marcello Fitton 2026-03-06 21:58:25 -08:00 committed by GitHub
parent 179a823ab1
commit 113df6d013
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 1 deletions

View File

@ -90,6 +90,12 @@ export function ChatTooltips() {
delayShow={300} delayShow={300}
className="tooltip !text-xs" className="tooltip !text-xs"
/> />
<Tooltip
id="attach-item-btn"
place="top"
delayShow={300}
className="tooltip !text-xs"
/>
<DocumentLevelTooltip /> <DocumentLevelTooltip />
</> </>
); );

View File

@ -88,7 +88,12 @@ export default function AttachItem({
<> <>
<button <button
id="attach-item-btn" id="attach-item-btn"
data-tooltip-id="tooltip-attach-item-btn" data-tooltip-id={
showTooltip ? "tooltip-attach-item-btn" : "attach-item-btn"
}
data-tooltip-content={
!showTooltip ? t("chat_window.attach_file") : undefined
}
aria-label={t("chat_window.attach_file")} aria-label={t("chat_window.attach_file")}
type="button" type="button"
onClick={handleClick} onClick={handleClick}

View File

@ -23,6 +23,7 @@ import { safeJsonParse } from "@/utils/request";
import QuickActions from "@/components/lib/QuickActions"; import QuickActions from "@/components/lib/QuickActions";
import SuggestedMessages from "@/components/lib/SuggestedMessages"; import SuggestedMessages from "@/components/lib/SuggestedMessages";
import useUser from "@/hooks/useUser"; import useUser from "@/hooks/useUser";
import { ChatTooltips } from "@/components/WorkspaceChat/ChatContainer/ChatTooltips";
async function getTargetWorkspace() { async function getTargetWorkspace() {
const lastVisited = safeJsonParse( const lastVisited = safeJsonParse(
@ -301,6 +302,7 @@ function HomeContent({ workspace, setWorkspace, threadSlug, setThreadSlug }) {
/> />
</div> </div>
</DnDFileUploaderWrapper> </DnDFileUploaderWrapper>
<ChatTooltips />
</div> </div>
); );
} }