Skip to content

armgit / fider

Public Imported from GitHub
0

Open platform to collect and prioritize feedback

Fix the header for the new nav

Matt Roberts29827b86805e
diff --git a/public/components/Header.scss b/public/components/Header.scss
index f647c0e96..a2fc8eb99 100644
--- a/public/components/Header.scss
+++ b/public/components/Header.scss
@@ -7,17 +7,32 @@
align-items: center;
gap: 0.5rem;
width: 100%;
+
+ // Once everything fits on a single row, stop wrapping so the action
+ // icons can never spill onto a second line.
+ @include media("xl") {
+ flex-wrap: nowrap;
+ }
}
.c-header__brand {
flex-basis: 100%;
+ min-width: 0; // allow a long tenant name to truncate instead of pushing items off the row
@include media("md") {
flex-basis: auto;
}
+
+ h1 {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
}
.c-header__nav {
+ flex-shrink: 0;
+
@include media("md") {
margin-left: 0.5rem;
}
@@ -25,6 +40,7 @@
.c-header__actions {
margin-left: auto;
+ flex-shrink: 0;
}
.c-header__moderation {
@@ -35,12 +51,19 @@
order: 0;
flex: 0 1 auto;
flex-basis: auto;
+ // auto margins on both sides centre moderation in the free space between
+ // the nav and the actions group (the actions group drops its own auto
+ // margin at this breakpoint so only these two split the space evenly).
margin-left: auto;
+ margin-right: auto;
}
}
+ // Below xl the actions group is pushed right on the shared row; at xl
+ // moderation's auto margins handle the alignment instead, so reset this to
+ // keep the icons hard against the right edge with moderation centred.
@include media("xl") {
- .c-header__actions {
+ .c-header__moderation + .c-header__actions {
margin-left: 0;
}
}
diff --git a/public/pages/Roadmap/Roadmap.page.scss b/public/pages/Roadmap/Roadmap.page.scss
index 3a6175106..18e0d4023 100644
--- a/public/pages/Roadmap/Roadmap.page.scss
+++ b/public/pages/Roadmap/Roadmap.page.scss
@@ -29,7 +29,8 @@
}
}
-#p-roadmap-upsell {
+#p-roadmap-upsell,
+#p-roadmap-blank {
padding-top: spacing(8);
padding-bottom: spacing(12);
}
diff --git a/public/pages/Roadmap/Roadmap.page.tsx b/public/pages/Roadmap/Roadmap.page.tsx
index 98e47ab2d..910994591 100644
--- a/public/pages/Roadmap/Roadmap.page.tsx
+++ b/public/pages/Roadmap/Roadmap.page.tsx
@@ -61,6 +61,12 @@ const RoadmapBoard = (props: RoadmapPageProps) => {
onPostClosed: () => reloadPosts(),
})
+ const hasNoActivePosts = plannedPosts.length === 0 && startedPosts.length === 0
+
+ if (hasNoActivePosts && selectedPostId === null) {
+ return <RoadmapBlankState />
+ }
+
return (
<div id="p-roadmap" className="page container">
<div style={selectedPostId !== null ? { display: "none" } : undefined}>
@@ -110,6 +116,16 @@ const SkeletonColumn = ({ status }: { status: string }) => (
</div>
)
+const RoadmapSkeletonBackdrop = () => (
+ <div className="c-roadmap-upsell__skeleton" aria-hidden="true">
+ <div className="c-roadmap-board">
+ <SkeletonColumn status="planned" />
+ <SkeletonColumn status="started" />
+ <SkeletonColumn status="completed" />
+ </div>
+ </div>
+)
+
const RoadmapUpsell = () => {
const fider = useFider()
const isAdmin = fider.session.isAuthenticated && fider.session.user.isAdministrator
@@ -117,13 +133,7 @@ const RoadmapUpsell = () => {
return (
<div id="p-roadmap-upsell" className="page container">
- <div className="c-roadmap-upsell__skeleton" aria-hidden="true">
- <div className="c-roadmap-board">
- <SkeletonColumn status="planned" />
- <SkeletonColumn status="started" />
- <SkeletonColumn status="completed" />
- </div>
- </div>
+ <RoadmapSkeletonBackdrop />
<VStack spacing={4} className="c-roadmap-upsell flex-items-center text-center">
<h1 className="c-roadmap-upsell__title text-display">
<Trans id="roadmap.upsell.title">See what&apos;s happening in the Roadmap view</Trans>
@@ -143,6 +153,20 @@ const RoadmapUpsell = () => {
)
}
+const RoadmapBlankState = () => (
+ <div id="p-roadmap-blank" className="page container">
+ <RoadmapSkeletonBackdrop />
+ <VStack spacing={4} className="c-roadmap-upsell flex-items-center text-center">
+ <h1 className="c-roadmap-upsell__title text-display">
+ <Trans id="roadmap.blank.title">Your roadmap is waiting for its first update</Trans>
+ </h1>
+ <p className="c-roadmap-upsell__subtitle text-muted">
+ <Trans id="roadmap.blank.description">Mark posts as planned or in progress and they&apos;ll show up here on the roadmap.</Trans>
+ </p>
+ </VStack>
+ </div>
+)
+
const RoadmapPage = (props: RoadmapPageProps) => {
const fider = useFider()
const hasRoadmap = fider.isSingleHostMode() || fider.session.tenant.isPro