θΏ™ζ˜―indexlocζδΎ›ηš„ζœεŠ‘οΌŒδΈθ¦θΎ“ε…₯任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b069caf
prompt user to embed if exceeds prompt window + handle embed + handle…
shatfield4 Aug 1, 2025
a7f95bc
Merge branch 'upload-ui-ux' into upload-ui-ux-frontend-alert
timothycarambat Aug 1, 2025
a5c5ceb
add tokenCountEstimate to workspace_parsed_files + optimizations
shatfield4 Aug 1, 2025
46abdd9
use util for path locations + use safeJsonParse
shatfield4 Aug 1, 2025
3a8a72f
add modal for user decision on overflow of context window
shatfield4 Aug 2, 2025
3870639
lint
shatfield4 Aug 2, 2025
dd03431
dynamic fetching of provider/model combo + inject parsed documents
shatfield4 Aug 5, 2025
0323aa4
remove unneeded comments
shatfield4 Aug 5, 2025
b3f990a
popup ui for attaching/removing files + warning to embed + wip fetchi…
shatfield4 Aug 6, 2025
163f116
remove prop drilling, fetch files/limits directly in attach files popup
shatfield4 Aug 6, 2025
7917134
rework ux of FE + BE optimizations
shatfield4 Aug 7, 2025
346e6ea
fix ux of FE + BE optimizations
shatfield4 Aug 7, 2025
4cdaf65
Merge branch 'master' into upload-ui-ux-frontend-alert
shatfield4 Aug 7, 2025
a59199b
Implement bidirectional sync for parsed file states
timothycarambat Aug 8, 2025
954cc38
move parse support to another endpoint file
timothycarambat Aug 8, 2025
1f97a01
button borders
timothycarambat Aug 8, 2025
1eddfe1
enable default users to upload parsed files but NOT embed
timothycarambat Aug 8, 2025
a7c3455
delete cascade on user/workspace/thread deletion to remove parsedFile…
timothycarambat Aug 8, 2025
2c1403c
enable bgworker with "always" jobs and optional document sync jobs
timothycarambat Aug 8, 2025
86ca832
change run timeout for orphan job to 1m to allow settling before spaw…
timothycarambat Aug 8, 2025
f7da6b5
linting and cleanup pr
timothycarambat Aug 8, 2025
c8b0d8f
Merge branch 'upload-ui-ux' into upload-ui-ux-frontend-alert
timothycarambat Aug 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ export function ChatTooltips() {
delayShow={500}
className="tooltip !text-xs max-w-[350px]"
/>
<Tooltip
id="context-window-limit-exceeded"
place="top"
delayShow={500}
className="tooltip !text-xs max-w-[350px]"
/>
<DocumentLevelTooltip />
</>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
import { CircleNotch } from "@phosphor-icons/react";
import ModalWrapper from "@/components/ModalWrapper";
import pluralize from "pluralize";
import { numberWithCommas } from "@/utils/numbers";
import useUser from "@/hooks/useUser";
import { Link } from "react-router-dom";
import Paths from "@/utils/paths";
import Workspace from "@/models/workspace";

export default function FileUploadWarningModal({
show,
onClose,
onContinue,
onEmbed,
tokenCount,
maxTokens,
fileCount = 1,
isEmbedding = false,
embedProgress = 0,
}) {
const { user } = useUser();
const canEmbed = !user || user.role !== "default";
if (!show) return null;

if (isEmbedding) {
return (
<ModalWrapper isOpen={show}>
<div className="relative max-w-[600px] bg-theme-bg-primary rounded-lg shadow border border-theme-modal-border">
<div className="p-6 flex flex-col items-center justify-center">
<p className="text-white text-lg font-semibold mb-4">
Embedding {embedProgress + 1} of {fileCount}{" "}
{pluralize("file", fileCount)}
</p>
<CircleNotch size={32} className="animate-spin text-white" />
<p className="text-white/60 text-sm mt-2">
Please wait while we embed your files...
</p>
</div>
</div>
</ModalWrapper>
);
}

return (
<ModalWrapper isOpen={show}>
<div className="relative max-w-[600px] bg-theme-bg-primary rounded-lg shadow border border-theme-modal-border">
<div className="relative p-6 border-b border-theme-modal-border">
<div className="w-full flex gap-x-2 items-center">
<h3 className="text-xl font-semibold text-white overflow-hidden overflow-ellipsis whitespace-nowrap">
Context Window Warning
</h3>
</div>
</div>

<div className="py-7 px-9 space-y-4">
<p className="text-theme-text-primary text-sm">
Your workspace is using {numberWithCommas(tokenCount)} of{" "}
{numberWithCommas(maxTokens)} available tokens. We recommend keeping
usage below {(Workspace.maxContextWindowLimit * 100).toFixed(0)}% to
ensure the best chat experience. Adding {fileCount} more{" "}
{pluralize("file", fileCount)} would exceed this limit.{" "}
<Link
target="_blank"
to={Paths.documentation.contextWindows()}
className="text-theme-text-secondary text-sm underline"
>
Learn more about context windows &rarr;
</Link>
</p>
<p className="text-theme-text-primary text-sm">
Choose how you would like to proceed with these uploads.
</p>
</div>

<div className="flex w-full justify-between items-center p-6 space-x-2 border-t border-theme-modal-border rounded-b">
<button
onClick={onClose}
type="button"
className="border-none transition-all duration-300 bg-theme-modal-border text-white hover:opacity-60 px-4 py-2 rounded-lg text-sm"
>
Cancel
</button>
<div className="flex w-full justify-end items-center space-x-2">
<button
onClick={onContinue}
type="button"
className="border-none transition-all duration-300 bg-theme-modal-border text-white hover:opacity-60 px-4 py-2 rounded-lg text-sm"
>
Continue Anyway
</button>
{canEmbed && (
<button
onClick={onEmbed}
disabled={isEmbedding || !canEmbed}
type="button"
className="border-none transition-all duration-300 bg-white text-black hover:opacity-60 px-4 py-2 rounded-lg text-sm"
>
Embed {pluralize("File", fileCount)}
</button>
)}
</div>
</div>
</div>
</ModalWrapper>
);
}
Loading