Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve AnyParser Sandbox UI #326

Merged
merged 4 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion app/components/playground/ExtractSettingsChecklist.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const ExtractSettingsChecklist = ({ removePIIOnly }: ExtractSettingsChecklistPro
const { extractSettings, toggleExtractSetting } = usePlaygroundStore();
return (
<div
className={`relative flex flex-col items-start justify-center gap-4 border-[1px] border-neutral-200 rounded-lg p-4 w-full shadow-md max-w-[350px] lg:max-w-[200px]`}
className={`relative flex flex-col items-start justify-center gap-4 border-[1px] border-neutral-200 rounded-lg p-4 w-full shadow-md max-w-[450px] lg:max-w-[400px]`}
>
<div className="font-semibold text-sm text-neutral-800">Remove from output:</div>
<div className={`grid ${removePIIOnly ? 'grid-cols-1' : 'grid-cols-2'} lg:grid-cols-1 gap-2`}>
Expand Down
12 changes: 9 additions & 3 deletions app/components/playground/MarkdownExtractContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,15 @@ const MarkdownExtractContainer = () => {
<div className="flex flex-col h-full justify-start items-center text-lg text-center gap-4 pt-[calc(20vh-120px)] lg:pt-[calc(30vh-120px)]">
<div className="flex flex-col items-center justify-center">
<span id="extract-file-name">{filename}</span>
<div className="w-fit mt-2">

{/* First row with two buttons side by side */}
<div className="flex gap-4 items-center justify-center mt-8">
<ModelToggleDropdown />
<ExtractSettingsChecklist removePIIOnly={isProduction} />
</div>

{/* Extract button below */}
<div className="w-fit mt-8">
<Button
label="Extract Plain Text"
onClick={() => handleExtract()}
Expand All @@ -385,8 +393,6 @@ const MarkdownExtractContainer = () => {
/>
</div>
</div>
<ModelToggleDropdown />
<ExtractSettingsChecklist removePIIOnly={isProduction} />
</div>
)}
{selectedFile?.extractState === ExtractState.UPLOADING && (
Expand Down
6 changes: 3 additions & 3 deletions app/components/playground/ModelToggleDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ const ModelToggleDropdown = () => {
setIsOpen(false);
};

const miniLabel = 'AP-base';
const proLabel = 'AP-pro';
const ultraLabel = 'AP-ultra';
const miniLabel = 'AnyParser-base';
const proLabel = 'AnyParser-pro';
const ultraLabel = 'AnyParser-ultra';

const modelTypes = Object.values(ModelType).filter((value): value is ModelType => typeof value === 'number');

Expand Down
2 changes: 1 addition & 1 deletion app/hooks/usePlaygroundStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const initialFileState = {
};

const usePlaygroundStore = create<PlaygroundStore>((set) => ({
modelType: ModelType.BASE,
modelType: ModelType.PRO,
extractSettings: {
removePII: true,
includePageNumbers: true,
Expand Down
Loading