mirror of
https://github.com/nexu-io/open-design.git
synced 2026-10-27 09:51:12 +01:00
fix(web): hide stale upload error banner when previewing other files (#994)
The upload-failure banner in FileWorkspace renders unconditionally inside ws-body, so a failed upload's error message stayed pinned above any file the user opened next. The banner is information about the Design Files upload surface, not the active file viewer; once the user clicks an existing file in the list, the message becomes unrelated stale state. Scope the banner to activeTab === DESIGN_FILES_TAB so previewing any file hides it. The error stays in state, so returning to the Design Files tab brings it back: the failed upload is still unaddressed and we do not want to silently drop that signal entirely. Co-authored-by: Nagendhra <nagendhra405@gmail.com>
This commit is contained in:
co-authored by
Nagendhra
parent
afb331a288
commit
8a8e33d31b
@@ -621,7 +621,28 @@ export function FileWorkspace({
|
||||
) : null}
|
||||
</div>
|
||||
<div className="ws-body">
|
||||
{uploadError ? <div className="viewer-empty">{uploadError}</div> : null}
|
||||
{/* Keep the failure banner visible across tab switches so the
|
||||
partial-success case (some files succeed and auto-open while
|
||||
others fail) doesn't silently drop the failure signal. The
|
||||
banner now carries an explicit dismiss button so the user
|
||||
can clear the stale message themselves, which is what #786
|
||||
was really asking for: a way to drop the message rather than
|
||||
have it pinned above an unrelated file preview forever. The
|
||||
next upload also clears it via setUploadError(null) at the
|
||||
top of uploadFiles(). */}
|
||||
{uploadError ? (
|
||||
<div className="viewer-empty viewer-empty-dismissible">
|
||||
<span>{uploadError}</span>
|
||||
<button
|
||||
type="button"
|
||||
className="ghost"
|
||||
aria-label={t('common.close')}
|
||||
onClick={() => setUploadError(null)}
|
||||
>
|
||||
{t('common.close')}
|
||||
</button>
|
||||
</div>
|
||||
) : null}
|
||||
{activeTab === DESIGN_FILES_TAB ? (
|
||||
<DesignFilesPanel
|
||||
key={projectId}
|
||||
|
||||
@@ -8692,6 +8692,17 @@ button.ghost.mcp-copy-btn:hover:not(:disabled) {
|
||||
color: var(--text-muted);
|
||||
font-size: 13px;
|
||||
}
|
||||
/* Compact horizontal variant for the upload-failure banner: the message
|
||||
sits inline next to a dismiss button so the user can clear the stale
|
||||
notice without changing tabs. Issue #786. */
|
||||
.viewer-empty.viewer-empty-dismissible {
|
||||
padding: 12px 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 12px;
|
||||
text-align: left;
|
||||
}
|
||||
.document-preview {
|
||||
max-width: 860px;
|
||||
margin: 0 auto;
|
||||
|
||||
Reference in New Issue
Block a user