refactor(web): keep feature component helpers private (#10226)
This commit is contained in:
1 parent
fdcc491e0b
commit
226abe5f91
31 files changed
+46
-79
No files matched your search
@@ -39,7 +39,7 @@ function buildTooltipContent(context: ElementContextDraft): string {
|
||||
return lines.join("\n");
|
||||
}
|
||||
|
||||
export function ComposerPendingElementContextChip({
|
||||
function ComposerPendingElementContextChip({
|
||||
context,
|
||||
onRemove,
|
||||
}: ComposerPendingElementContextChipProps) {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { cn } from "~/lib/utils";
|
||||
import {
|
||||
type TerminalContextDraft,
|
||||
formatTerminalContextLabel,
|
||||
@@ -6,11 +5,6 @@ import {
|
||||
} from "~/lib/terminalContext";
|
||||
import { TerminalContextInlineChip } from "./TerminalContextInlineChip";
|
||||
|
||||
interface ComposerPendingTerminalContextsProps {
|
||||
contexts: ReadonlyArray<TerminalContextDraft>;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
interface ComposerPendingTerminalContextChipProps {
|
||||
context: TerminalContextDraft;
|
||||
}
|
||||
@@ -26,19 +20,3 @@ export function ComposerPendingTerminalContextChip({
|
||||
|
||||
return <TerminalContextInlineChip label={label} tooltipText={tooltipText} expired={expired} />;
|
||||
}
|
||||
|
||||
export function ComposerPendingTerminalContexts(props: ComposerPendingTerminalContextsProps) {
|
||||
const { contexts, className } = props;
|
||||
|
||||
if (contexts.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={cn("flex flex-wrap gap-1.5", className)}>
|
||||
{contexts.map((context) => (
|
||||
<ComposerPendingTerminalContextChip key={context.id} context={context} />
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -9,8 +9,8 @@ import {
|
||||
} from "../../providerInstances";
|
||||
import { getTriggerDisplayModelName, type ModelEsque } from "./providerIconUtils";
|
||||
|
||||
export const CLAUDE_RESUME_COMPACTION_MINUTES = 70;
|
||||
export const CLAUDE_RESUME_COMPACTION_TOKENS = 100_000;
|
||||
const CLAUDE_RESUME_COMPACTION_MINUTES = 70;
|
||||
const CLAUDE_RESUME_COMPACTION_TOKENS = 100_000;
|
||||
|
||||
export function providerSupportsManualCompaction(
|
||||
provider: ProviderInstanceEntry | null | undefined,
|
||||
|
||||
@@ -14,7 +14,6 @@ import {
|
||||
} from "@t3tools/client-runtime/work-log/presentation";
|
||||
export {
|
||||
normalizeCompactToolLabel,
|
||||
summarizeToolGroup,
|
||||
toolGroupAction,
|
||||
} from "@t3tools/client-runtime/work-log/presentation";
|
||||
import {
|
||||
@@ -31,11 +30,11 @@ import { type ChatMessage, type ProposedPlan, type TurnDiffSummary } from "../..
|
||||
import { type MessageId, type OrchestrationLatestTurn, type TurnId } from "@t3tools/contracts";
|
||||
import { formatWorkspaceRelativePath } from "../../filePathDisplay";
|
||||
|
||||
export const TIMELINE_MINIMAP_ITEM_SPACING = 8;
|
||||
const TIMELINE_MINIMAP_ITEM_SPACING = 8;
|
||||
export const TIMELINE_MINIMAP_MIN_ITEMS = 2;
|
||||
export const TIMELINE_MINIMAP_MAX_HEIGHT_CSS = "calc(100vh - 18rem)";
|
||||
export const TIMELINE_CONTENT_MAX_WIDTH = 768;
|
||||
export const TIMELINE_MINIMAP_PERSISTENT_GUTTER = 48;
|
||||
const TIMELINE_MINIMAP_MAX_HEIGHT_CSS = "calc(100vh - 18rem)";
|
||||
const TIMELINE_CONTENT_MAX_WIDTH = 768;
|
||||
const TIMELINE_MINIMAP_PERSISTENT_GUTTER = 48;
|
||||
|
||||
function singleToolCallLabel(entry: WorkLogEntry): string {
|
||||
const toolPresentation = resolveWorkEntryToolPresentation(entry, "completed");
|
||||
@@ -145,7 +144,7 @@ export interface TimelineEndState {
|
||||
* A small pixel band (instead of the 1px isAtEnd epsilon alone) keeps re-arming
|
||||
* reliable while streaming content is still growing under the viewport.
|
||||
*/
|
||||
export const TIMELINE_FOLLOW_REARM_THRESHOLD_PX = 40;
|
||||
const TIMELINE_FOLLOW_REARM_THRESHOLD_PX = 40;
|
||||
|
||||
export function resolveTimelineIsAtEnd(state: TimelineEndState | undefined): boolean | undefined {
|
||||
if (!state) {
|
||||
@@ -207,9 +206,9 @@ export function resolveTimelineMinimapHasPersistentGutter(viewportWidth: number)
|
||||
return sideGutter >= TIMELINE_MINIMAP_PERSISTENT_GUTTER;
|
||||
}
|
||||
|
||||
export const TIMELINE_MINIMAP_HIT_STRIP_LEFT = 12;
|
||||
export const TIMELINE_MINIMAP_HIT_STRIP_MAX_WIDTH = 40;
|
||||
export const TIMELINE_MINIMAP_EXPANDED_HIT_STRIP_WIDTH = "22rem";
|
||||
const TIMELINE_MINIMAP_HIT_STRIP_LEFT = 12;
|
||||
const TIMELINE_MINIMAP_HIT_STRIP_MAX_WIDTH = 40;
|
||||
const TIMELINE_MINIMAP_EXPANDED_HIT_STRIP_WIDTH = "22rem";
|
||||
|
||||
/**
|
||||
* The minimap overlays the viewport's left edge while the content column is
|
||||
|
||||
@@ -35,7 +35,7 @@ const EXTERNAL_LINK_CONTEXT_MENU_ITEMS = [
|
||||
* whole menu with the one item that cannot be honoured is what left a right-click on a link
|
||||
* showing the platform's cut-and-paste menu instead of a way to copy the link.
|
||||
*/
|
||||
export function externalLinkContextMenuItems(options: {
|
||||
function externalLinkContextMenuItems(options: {
|
||||
readonly canOpenInPreview: boolean;
|
||||
readonly threadLinkAction?: "link-to-thread" | "unlink-from-thread" | undefined;
|
||||
}): readonly ContextMenuItem<ExternalLinkContextMenuAction>[] {
|
||||
|
||||
Reference in new issue
Block a user