mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-04 09:29:28 +08:00
Immersive Reading, self-configuration, and a two-way IMA library. - Immersive Reading: a new capability that opens a document beside the thread. New reading engine (PDF pages / slides / page-sized sections), five reading tools, a deterministic locate pre-pass that grounds the turn without a second LLM call, /api/v1/reading, and a reader pane with selection, highlights, notes, and export to an annotated PDF or Markdown. - Setup capability: inspect the install, apply a setting, install a parsing engine, or request a credential from a chat turn. New settings spec table; a candidate value is probed before it is committed, and API keys never enter the model's context. - Tencent IMA: pipeline split into transport/envelope/models/sources/ notes/media/inventory, an additive capability with five tools, and connected libraries that can finally be enumerated (bounded listings are reported as a lower bound). - Retrieval: supports_rag_retrieval() replaces is_connected_kb() for the "can I sweep this?" question, so linked / lightrag_server / ima sources stop being silently dropped from every book. - Notebooks: their own console at /notebook, per-notebook locks and atomic writes, copy / move / export routes, damaged files surfaced instead of dropped, and renaming a record no longer clears its knowledge-base link. - Settings persistence: one lock and one atomic replace shared by every writer of interface.json; the PUT endpoints stop writing the defaults-merged view back to disk. Release notes: assets/releases/ver1-5-14.md
47 lines
1.6 KiB
TypeScript
47 lines
1.6 KiB
TypeScript
"use client";
|
|
|
|
import type { ReactNode } from "react";
|
|
|
|
/**
|
|
* Instant CSS tooltip — replaces the native `title` attribute, whose
|
|
* ~1s OS-controlled hover delay makes icon-only buttons feel
|
|
* unresponsive. Fades in after a ~150ms hover-intent delay and also
|
|
* shows on keyboard focus. Pure CSS (group-hover, no portal), so
|
|
* callers should avoid mounting it flush against an overflow-hidden
|
|
* edge where the label would clip.
|
|
*/
|
|
export default function Tooltip({
|
|
label,
|
|
side = "bottom",
|
|
suppressed = false,
|
|
children,
|
|
}: {
|
|
label: string;
|
|
/** Which side of the trigger the label appears on. */
|
|
side?: "top" | "bottom";
|
|
/**
|
|
* Hide the label while keeping the trigger mounted. Set this when the
|
|
* trigger has opened something of its own (a menu, a popover): the pointer
|
|
* is still over the button, so the tooltip would otherwise sit on top of
|
|
* the very surface it just opened.
|
|
*/
|
|
suppressed?: boolean;
|
|
children: ReactNode;
|
|
}) {
|
|
const place = side === "bottom" ? "top-full mt-1.5" : "bottom-full mb-1.5";
|
|
return (
|
|
<span className="group/tip relative inline-flex">
|
|
{children}
|
|
{suppressed ? null : (
|
|
<span
|
|
role="tooltip"
|
|
aria-hidden
|
|
className={`pointer-events-none absolute left-1/2 z-[80] -translate-x-1/2 ${place} whitespace-nowrap rounded-md bg-[var(--foreground)] px-2 py-1 text-[11px] font-medium leading-none text-[var(--background)] opacity-0 shadow-md transition-opacity duration-100 group-focus-within/tip:opacity-100 group-hover/tip:opacity-100 group-hover/tip:delay-150`}
|
|
>
|
|
{label}
|
|
</span>
|
|
)}
|
|
</span>
|
|
);
|
|
}
|