topbar: surface publish warnings instead of discarding them
handlePublish's JSON response has always included a `warnings` array (e.g. the contact-form relay's "submissions will not be delivered" notice), but nothing in the editor ever read it. Adds a PublishWarnings banner, held in its own state independent of the 3s publishStatus flash so the customer has time to read it, rendered in both the desktop and mobile TopBar branches. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
2b1569202a
commit
d460e8ac33
4 files changed
+132
No files matched your search
@@ -106,6 +106,11 @@ body {
|
||||
border-bottom: 1px solid var(--color-border);
|
||||
z-index: 100;
|
||||
gap: 12px;
|
||||
/* Positioned ancestor for .publish-warnings (position: absolute; top:
|
||||
100%), which is rendered as this <nav>'s first child in both the
|
||||
desktop and mobile branches -- without this, it would anchor to the
|
||||
viewport instead of sitting directly under the topbar. */
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.topbar-left,
|
||||
@@ -1884,3 +1889,33 @@ body {
|
||||
height: 44px !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
Publish warnings banner -- non-blocking; the site DID publish. Anchored
|
||||
to .topbar's `position: relative` (see above) so it drops down directly
|
||||
beneath the bar in both the desktop and mobile branches.
|
||||
-------------------------------------------------------------------------- */
|
||||
.publish-warnings {
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 40;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 8px;
|
||||
padding: 10px 12px;
|
||||
background: #422006;
|
||||
border-bottom: 1px solid #a16207;
|
||||
color: #fde68a;
|
||||
font-size: 12px;
|
||||
}
|
||||
.publish-warnings ul { margin: 0; padding-left: 16px; flex: 1; }
|
||||
.publish-warnings li { margin: 2px 0; }
|
||||
.publish-warnings button {
|
||||
background: none;
|
||||
border: none;
|
||||
color: #fde68a;
|
||||
cursor: pointer;
|
||||
padding: 0 4px;
|
||||
}
|
||||
Reference in new issue
Block a user