Skip to content

Commit cff7d3f

Browse files
committed
fix zrok version dropdown
1 parent 7e15556 commit cff7d3f

6 files changed

Lines changed: 74 additions & 79 deletions

File tree

packages/docusaurus-theme/css/product-picker.css

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,34 @@
134134
.nf-picker-panel--narrow { max-width: 430px; padding: 0.85rem 1.25rem; }
135135

136136

137-
/* Ensure visibility when open */
138-
.dropdown--show > .dropdown__menu,
139-
.dropdown:hover > .dropdown__menu {
137+
/*
138+
* Click-only dropdowns — how this works:
139+
*
140+
* Infima (Docusaurus's base CSS) shows .dropdown__menu on :hover by default.
141+
* Our swizzled DropdownNavbarItem/Desktop uses JS click to toggle the
142+
* `dropdown--show` class instead. We need CSS to respect that.
143+
*
144+
* The trick: both rules below have the same specificity (0,3,0). The hide
145+
* rule kills Infima's hover behaviour; the show rule comes *later* in the
146+
* file, so it wins the cascade when `dropdown--show` is present — even while
147+
* the user is hovering.
148+
*
149+
* To verify: hover over any navbar dropdown → menu stays closed.
150+
* Click the trigger → menu opens and stays open while hovering.
151+
* Click a menu item or anywhere outside → menu closes.
152+
*/
153+
.navbar__item.dropdown:hover .dropdown__menu,
154+
.navbar__item.dropdown:hover > .dropdown__menu {
155+
display: none;
156+
visibility: hidden;
157+
opacity: 0;
158+
pointer-events: none;
159+
}
160+
.navbar__item.dropdown.dropdown--show .dropdown__menu {
140161
display: block;
141162
visibility: visible;
142163
opacity: 1;
164+
pointer-events: auto;
143165
}
144166

145167
/* ── Grid layout ────────────────────────────────────────────────────────── */

packages/docusaurus-theme/theme/NavbarItem/DropdownNavbarItem/Desktop/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,11 @@ export default function DropdownNavbarItemDesktop({
5454
aria-haspopup="true"
5555
aria-expanded={showDropdown}
5656
role="button"
57-
href={props.to ? undefined : '#'}
57+
href="#"
5858
className={clsx('navbar__link', className)}
5959
{...props}
60-
onClick={props.to ? undefined : handleClick}
60+
to={undefined}
61+
onClick={handleClick}
6162
onKeyDown={(e: React.KeyboardEvent) => {
6263
if (e.key === 'Enter') {
6364
e.preventDefault();
@@ -66,7 +67,7 @@ export default function DropdownNavbarItemDesktop({
6667
}}>
6768
{props.children ?? props.label}
6869
</NavbarNavLink>
69-
<ul className="dropdown__menu">
70+
<ul className="dropdown__menu" onClick={() => setShowDropdown(false)}>
7071
{items.map((childItemProps: any, i: number) => (
7172
<NavbarItem
7273
isDropdownItem

unified-doc/build-docs.ps1

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ param(
2929
[string]$FrontdoorBranch = "develop",
3030
[string]$SelfhostedBranch = "main",
3131
[string]$ZlanBranch = "main",
32+
[string]$PlatformBranch = "main",
3233

3334
# Remove all _remotes content and .docusaurus cache before building
3435
[switch]$Clean,
@@ -46,7 +47,7 @@ param(
4647
[string]$Qualifier = "",
4748

4849
# Docusaurus build mask (hex). 0x1=openziti, 0x2=frontdoor, 0x4=selfhosted,
49-
# 0x8=zrok, 0x10=zlan, 0xFF=all
50+
# 0x8=zrok, 0x10=zlan, 0x20=platform, 0xFF=all
5051
[string]$BuildMask = "0xFF"
5152
)
5253

@@ -98,10 +99,9 @@ function Invoke-CloneOrUpdate {
9899

99100
$target = Join-Path $remotesDir $Dest
100101
$redactedUrl = $Url -replace '://[^@]+@', '://[REDACTED]@'
101-
Write-Host "bd clone_or_update: dest='$Dest' branch='$Branch' url='$redactedUrl'"
102102

103103
if (Test-Path (Join-Path $target ".git")) {
104-
Write-Host "bd existing repo detected; fetching branch '$Branch'"
104+
Write-Host "Updating '$Dest' @ '$Branch'..."
105105
git -C $target remote set-url origin $Url 2>&1 | Out-Null
106106
if ($LASTEXITCODE -ne 0) {
107107
git -C $target remote add origin $Url 2>&1 | Out-Null
@@ -119,14 +119,13 @@ function Invoke-CloneOrUpdate {
119119
if ($LASTEXITCODE -ne 0) {
120120
Write-Error "Failed to reset '$target' to FETCH_HEAD"
121121
}
122-
Write-Host "bd fetch+reset succeeded"
123122
return
124123
} elseif (Test-Path $target) {
125124
Write-Host "ERROR: $target exists but is not a git repo"
126125
Get-ChildItem $target | Format-List Name
127126
exit 1
128127
} else {
129-
Write-Host "bd cloning branch '$Branch' -> '$target'"
128+
Write-Host "Cloning '$Dest' @ '$Branch'..."
130129
git clone --single-branch --branch $Branch --depth 1 $Url $target
131130
if ($LASTEXITCODE -ne 0) {
132131
Write-Host "ERROR: Clone failed. Available branches in $redactedUrl :"
@@ -135,7 +134,6 @@ function Invoke-CloneOrUpdate {
135134
}
136135
exit 1
137136
}
138-
Write-Host "bd clone succeeded"
139137
}
140138
}
141139

@@ -166,7 +164,8 @@ function Invoke-LintDocs {
166164
(Join-Path $remotesDir "frontdoor\docusaurus\docs"),
167165
(Join-Path $remotesDir "zrok\website\docs"),
168166
(Join-Path $remotesDir "selfhosted\docusaurus\docs"),
169-
(Join-Path $remotesDir "openziti\docusaurus\docs")
167+
(Join-Path $remotesDir "openziti\docusaurus\docs"),
168+
(Join-Path $remotesDir "platform\docusaurus\docs")
170169
)
171170
$targets = $potentialTargets | Where-Object { Test-Path $_ }
172171

@@ -224,13 +223,16 @@ Write-Host " ZrokBranch: $ZrokBranch"
224223
Write-Host " FrontdoorBranch: $FrontdoorBranch"
225224
Write-Host " SelfhostedBranch: $SelfhostedBranch"
226225
Write-Host " ZlanBranch: $ZlanBranch"
226+
Write-Host " PlatformBranch: $PlatformBranch"
227227
Write-Host " Clean: $Clean"
228228
Write-Host " LintOnly: $LintOnly"
229229
Write-Host " SkipLinkedDoc: $SkipLinkedDoc"
230230
Write-Host " NoMinify: $NoMinify"
231231
Write-Host " Qualifier: '$Qualifier'"
232232
Write-Host " BuildMask: $BuildMask"
233233
Write-Host " IS_VERCEL: $($env:IS_VERCEL)"
234+
Write-Host " node: $(node --version 2>$null)"
235+
Write-Host " yarn: $(yarn --version 2>$null)"
234236

235237
if ($Clean) {
236238
Write-Host "CLEAN: removing _remotes contents (preserving package.json)"
@@ -264,13 +266,20 @@ $urlSelfhosted = Get-RepoUrl `
264266

265267
$urlZrok = "https://github.com/openziti/zrok.git" # public; no auth needed
266268

269+
$urlPlatform = Get-RepoUrl `
270+
-DefaultHttpsUrl "https://bitbucket.org/netfoundry/platform-doc.git" `
271+
-TokenEnvVar "BB_REPO_TOKEN_PLATFORM_DOC" `
272+
-SshUrl "git@bitbucket.org:netfoundry/platform-doc.git" `
273+
-UsernameEnvVar "BB_USERNAME"
274+
267275
# ─── CLONE / UPDATE REMOTES ───────────────────────────────────────────────────
268276

269277
Invoke-CloneOrUpdate $urlFrontdoor "frontdoor" $FrontdoorBranch
270278
Invoke-CloneOrUpdate $urlSelfhosted "selfhosted" $SelfhostedBranch
271279
Invoke-CloneOrUpdate $urlZitiDoc "openziti" $ZitiDocBranch
272280
Invoke-CloneOrUpdate $urlZlan "zlan" $ZlanBranch
273281
Invoke-CloneOrUpdate $urlZrok "zrok" $ZrokBranch
282+
Invoke-CloneOrUpdate $urlPlatform "platform" $PlatformBranch
274283

275284
# Remove stale Docusaurus caches and build outputs from inside the cloned remotes.
276285
# A leftover .docusaurus/ or build/ from a prior run can confuse the unified-doc build.

unified-doc/build-docs.sh

Lines changed: 24 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -93,34 +93,19 @@ while [[ $# -gt 0 ]]; do
9393
esac
9494
done
9595

96-
# --- DEBUG CONFIG ---
9796
echo "========================================"
98-
echo "bd BUILD ENVIRONMENT DEBUG"
97+
echo "BUILD CONFIGURATION"
9998
echo "========================================"
100-
echo "bd CLEAN=$CLEAN"
101-
echo "bd BUILD_QUALIFIER='$BUILD_QUALIFIER'"
102-
echo "bd QUALIFIER_FLAG: ${QUALIFIER_FLAG[*]:-}"
103-
echo "bd OTHER_FLAGS: ${OTHER_FLAGS[*]:-}"
104-
echo "bd EXTRA_ARGS: ${EXTRA_ARGS[*]:-}"
105-
echo "bd BRANCH_ZITI_DOC='$BRANCH_ZITI_DOC'"
106-
echo "bd BRANCH_ZROK='$BRANCH_ZROK'"
107-
echo "bd BRANCH_FRONTDOOR='$BRANCH_FRONTDOOR'"
108-
echo "bd BRANCH_SELFHOSTED='$BRANCH_SELFHOSTED'"
109-
echo "bd BRANCH_ZLAN='$BRANCH_ZLAN'"
110-
echo "bd BRANCH_PLATFORM='$BRANCH_PLATFORM'"
111-
echo "----------------------------------------"
112-
echo "bd ENV VARS:"
113-
echo "bd IS_VERCEL='${IS_VERCEL:-}'"
114-
echo "bd VERCEL='${VERCEL:-}'"
115-
echo "bd VERCEL_ENV='${VERCEL_ENV:-}'"
116-
echo "bd CI='${CI:-}'"
117-
echo "bd NODE_ENV='${NODE_ENV:-}'"
118-
echo "bd PWD='$(pwd)'"
119-
echo "----------------------------------------"
120-
echo "bd VERSIONS:"
121-
echo "bd node: $(node --version 2>/dev/null || echo 'not found')"
122-
echo "bd yarn: $(yarn --version 2>/dev/null || echo 'not found')"
123-
echo "bd npm: $(npm --version 2>/dev/null || echo 'not found')"
99+
echo " BRANCH_ZITI_DOC='$BRANCH_ZITI_DOC'"
100+
echo " BRANCH_ZROK='$BRANCH_ZROK'"
101+
echo " BRANCH_FRONTDOOR='$BRANCH_FRONTDOOR'"
102+
echo " BRANCH_SELFHOSTED='$BRANCH_SELFHOSTED'"
103+
echo " BRANCH_ZLAN='$BRANCH_ZLAN'"
104+
echo " BRANCH_PLATFORM='$BRANCH_PLATFORM'"
105+
echo " CLEAN=$CLEAN"
106+
echo " IS_VERCEL='${IS_VERCEL:-}'"
107+
echo " node: $(node --version 2>/dev/null || echo 'not found')"
108+
echo " yarn: $(yarn --version 2>/dev/null || echo 'not found')"
124109
echo "========================================"
125110

126111
script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
@@ -133,7 +118,6 @@ clone_or_update() {
133118
local url="$1" dest="$2" branch="${3:-main}"
134119
local target="$script_dir/_remotes/$dest"
135120

136-
echo "bd clone_or_update url='$url' dest='$dest' branch='$branch' target='$target' CLEAN='${CLEAN:-0}'"
137121

138122
# --- AUTHENTICATION LOGIC ---
139123
case "$url" in
@@ -187,10 +171,8 @@ clone_or_update() {
187171
;;
188172
esac
189173

190-
echo "bd clone_or_update effective_url='${url//:*@/://[REDACTED]@}'"
191-
192174
if [ -d "$target/.git" ]; then
193-
echo "bd existing repo detected; fetching branch '$branch'"
175+
echo "Updating '$dest' @ '$branch'..."
194176
git -C "$target" remote set-url origin "$url" 2>&1 || git -C "$target" remote add origin "$url" 2>&1 || true
195177
if ! git -C "$target" fetch --depth 1 origin "$branch" 2>&1 \
196178
|| ! git -C "$target" reset --hard FETCH_HEAD 2>&1; then
@@ -199,19 +181,17 @@ clone_or_update() {
199181
git ls-remote --heads "$url" | awk '{print $2}' | sed 's|refs/heads/||'
200182
exit 1
201183
fi
202-
echo "bd fetch+reset succeeded"
203184
elif [ -d "$target" ]; then
204185
echo "${target} exists but is not a git repo."
205186
ls -la "$target" 2>&1 || true
206187
exit 1
207188
else
208-
echo "bd cloning branch '$branch' -> '$target'"
189+
echo "Cloning '$dest' @ '$branch'..."
209190
if ! git clone --single-branch --branch "$branch" --depth 1 "$url" "$target" 2>&1; then
210191
echo "❌ Clone failed. Available branches in ${url//:*@/://[REDACTED]@}:"
211192
git ls-remote --heads "$url" | awk '{print $2}' | sed 's|refs/heads/||'
212193
exit 1
213194
fi
214-
echo "bd clone succeeded"
215195
fi
216196
}
217197

@@ -345,12 +325,8 @@ lint_docs() {
345325
# =============================================================================
346326
# MAIN EXECUTION
347327
# =============================================================================
348-
echo "bd DEBUG: scanning for git dirs under _remotes"
349-
find "$script_dir/_remotes" -name .git -type d 2>&1 || true
350-
351-
352328
if [ "${CLEAN:-0}" -eq 1 ]; then
353-
echo "bd CLEAN=1 removing contents of _remotes (preserving package.json)"
329+
echo "CLEAN: removing _remotes contents (preserving package.json)"
354330
find "$script_dir/_remotes" -mindepth 1 -maxdepth 1 ! -name 'package.json' -exec rm -rf {} +
355331
fi
356332

@@ -361,17 +337,8 @@ clone_or_update "https://github.com/netfoundry/zlan.git"
361337
clone_or_update "https://github.com/openziti/zrok.git" zrok "$BRANCH_ZROK"
362338
clone_or_update "https://bitbucket.org/netfoundry/platform-doc.git" platform "$BRANCH_PLATFORM"
363339

364-
echo "========================================"
365-
echo "bd POST-CLONE DEBUG"
366-
echo "========================================"
367-
echo "bd Directories in _remotes:"
368-
ls -la "$script_dir/_remotes" 2>/dev/null || echo " (none)"
369-
echo "----------------------------------------"
370-
echo "bd Looking for docusaurus build/ and .docusaurus/ dirs in remotes:"
371-
find "$script_dir/_remotes" -type d \( -path "*/docusaurus/build" -o -path "*/docusaurus/.docusaurus" -o -path "*/website/build" -o -path "*/website/.docusaurus" \) 2>/dev/null || echo " (none found)"
372-
echo "bd Cleaning stale build artifacts from remotes..."
340+
echo "Cleaning stale build artifacts from remotes..."
373341
find "$script_dir/_remotes" -type d \( -path "*/docusaurus/build" -o -path "*/docusaurus/.docusaurus" -o -path "*/website/build" -o -path "*/website/.docusaurus" \) -exec rm -rf {} + 2>/dev/null || true
374-
echo "========================================"
375342

376343
echo "copying versionable docs locally..."
377344
"${script_dir}/sync-versioned-remote.sh" zrok
@@ -397,30 +364,26 @@ pushd "${script_dir}" >/dev/null
397364
yarn install
398365

399366
if [ "${CLEAN:-0}" -eq 1 ]; then
400-
echo "bd CLEAN=1: running yarn clear to remove .docusaurus cache"
367+
echo "CLEAN: clearing Docusaurus cache"
401368
yarn clear
402369
fi
403370

404-
echo "========================================"
405-
echo "bd PRE-BUILD DEBUG"
406-
echo "========================================"
407-
echo "bd IS_VERCEL='${IS_VERCEL:-}'"
408-
echo "bd VERCEL='${VERCEL:-}'"
409-
echo "bd script_dir='${script_dir}'"
410-
echo "bd BUILD_QUALIFIER='${BUILD_QUALIFIER}'"
411-
echo "bd output dir: build${BUILD_QUALIFIER}"
412-
echo "========================================"
413-
414371
now=$(date)
415372
commit=$(git -C "${script_dir}" rev-parse --short HEAD 2>/dev/null || echo "unknown")
416373
printf "%s\n%s\n" "$now" "$commit" > "${script_dir}/static/build-time.txt"
417-
echo "BUILDING docs into: build${BUILD_QUALIFIER} at $now"
418374

419375
MINIFY_FLAG=""
420376
if [ -n "${NO_MINIFY:-}" ]; then
421377
MINIFY_FLAG="--no-minify"
422378
fi
423-
echo "NO_MINIFY flag: $MINIFY_FLAG"
379+
380+
echo "========================================"
381+
echo "DOCUSAURUS BUILD"
382+
echo "========================================"
383+
echo " Output dir: build${BUILD_QUALIFIER}"
384+
echo " Build mask: ${DOCUSAURUS_BUILD_MASK:-0xFF}"
385+
echo " No-minify: ${NO_MINIFY:-false}"
386+
echo "========================================"
424387

425388
yarn build $MINIFY_FLAG --out-dir "build${BUILD_QUALIFIER}" 2>&1
426389
popd >/dev/null

unified-doc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"@docusaurus/theme-mermaid": "^3.9.2",
5454
"@hotjar/browser": "^1.0.9",
5555
"@mdx-js/react": "^3.0.0",
56-
"@netfoundry/docusaurus-theme": "^0.10.19",
56+
"@netfoundry/docusaurus-theme": "^0.10.20",
5757
"algoliasearch": "^5.36.0",
5858
"asciinema-player": "^3.10.0",
5959
"clsx": "^2.0.0",

unified-doc/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2579,10 +2579,10 @@
25792579
hls.js "~1.6.6"
25802580
mux-embed "^5.8.3"
25812581

2582-
"@netfoundry/docusaurus-theme@^0.10.8":
2583-
version "0.10.19"
2584-
resolved "https://registry.yarnpkg.com/@netfoundry/docusaurus-theme/-/docusaurus-theme-0.10.19.tgz#7d353e11a08603f09b37c4d0f442edc678637f2b"
2585-
integrity sha512-saFPd3GJM+LJaOW3P3FJnwyRFDGaC7G389yM4HqfdusB8KTmaxLjTMcuE29zktMdgQer3wWTOyBYfqTBNxCpxA==
2582+
"@netfoundry/docusaurus-theme@^0.10.20":
2583+
version "0.10.20"
2584+
resolved "https://registry.yarnpkg.com/@netfoundry/docusaurus-theme/-/docusaurus-theme-0.10.20.tgz#e7b589b69aa24b81a4d7a81817e50adb93c35d59"
2585+
integrity sha512-LPkbGGIleX6y3OxNMw+o6BU1m+gV44uoHUGDOBd+JjymxWQ/Gze7N/p2zpvChhEMpkXMZeyXScpm+qjay7qbQA==
25862586
dependencies:
25872587
"@docsearch/react" "^3"
25882588
algoliasearch "^5"

0 commit comments

Comments
 (0)