refactor: simplify upload rules and remove destination flow

This commit is contained in:
Tom Boullay
2026-04-24 16:23:02 +02:00
parent 61a0146545
commit 944959fc22
20 changed files with 2033 additions and 217 deletions
+21 -17
View File
@@ -5,7 +5,6 @@ import { useSecret } from '@/hooks/useSecret'
import { useFolderEntries } from '@/hooks/useFolderEntries'
import { useUploadOrchestrator } from '@/hooks/useUploadOrchestrator'
import SecretInput from './upload/SecretInput'
import DestinationPicker from './upload/DestinationPicker'
import FolderDropzone from './upload/FolderDropzone'
import FolderCard from './upload/FolderCard'
import ActionButtons from './upload/ActionButtons'
@@ -38,8 +37,6 @@ export default function UploadZone() {
isUploading,
globalError,
setGlobalError,
destination,
setDestination,
overwriteConfirm,
setOverwriteConfirm,
noChangesFolder,
@@ -84,18 +81,28 @@ export default function UploadZone() {
onToggleVisible={toggleSecretVisible}
/>
<DestinationPicker
destination={destination}
disabled={isUploading}
onChange={setDestination}
/>
{entries.length === 0 && (
<FolderDropzone
isUploading={isUploading}
onFolderSelected={handleFolderSelected}
onError={setGlobalError}
/>
<div className="space-y-2">
<p className="text-xs text-gray-400 leading-relaxed text-center">
Deposez un dossier complet contenant votre modele 3D nomme
{' '}<span className="font-mono text-gray-200">model.glb</span>
{' '}ainsi que toutes les textures necessaires.
{' '}Les textures peuvent etre en
{' '}<span className="font-mono text-gray-200">.png</span>,
{' '}<span className="font-mono text-gray-200">.jpg</span>
{' '}ou <span className="font-mono text-gray-200">.webp</span>.
{' '}Utilisez un nom simple si la texture s&apos;applique au modele entier, et un nom detaille si elle correspond a une partie precise du modele,
{' '}par exemple <span className="font-mono text-gray-200">color_fenetre.jpg</span>,
{' '}<span className="font-mono text-gray-200">roughness_tuyaux.png</span>,
{' '}<span className="font-mono text-gray-200">normal_dashboard.webp</span>
{' '}ou <span className="font-mono text-gray-200">opacity_verre.png</span>.
</p>
<FolderDropzone
isUploading={isUploading}
onFolderSelected={handleFolderSelected}
onError={setGlobalError}
/>
</div>
)}
{globalError && (
@@ -119,7 +126,6 @@ export default function UploadZone() {
<ActionButtons
isUploading={isUploading}
isSecretEmpty={isSecretEmpty}
noDestination={!destination}
hasPendingOrErrors={hasPendingOrErrors}
allDone={allDone}
hasErrors={hasErrors}
@@ -130,7 +136,6 @@ export default function UploadZone() {
{overwriteConfirm && (
<OverwriteConfirmModal
destination={destination!}
folderName={overwriteConfirm.folderName}
diffs={overwriteConfirm.diffs}
onCancel={() => setOverwriteConfirm(null)}
@@ -140,7 +145,6 @@ export default function UploadZone() {
{noChangesFolder && (
<NoChangesModal
destination={destination!}
folderName={noChangesFolder}
onCancel={() => {
setNoChangesFolder(null)