Navbar marks the wrong item as the current page when two items link into the same sidebar
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 75/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- html, javascript, yaml
- 領域
- accessibility, web-dev
調査の方向性
issueで言及されているアクティブリンクのループを確認するため、まず src/project/types/website/website-navigation.ts を開き、続いて関連するissue #9277、#15190、#15191を参考として調べます。提供された _quarto.yml と2つのページで再現し、quarto render を実行して _site/get-started.html を確認します。現在のページに完全一致するリンクがアクティブになり、aria-current="page" を持つ状態が完了条件です。サイドバー内だけで一致する場合は aria-current="true" を使います。
索引モデルが issue の本文から書いたものです。
説明
I have:
- searched the issue tracker for similar issues
- installed the latest version of Quarto CLI
- formatted my issue following the Bug Reports guide
Bug description
In a website with a navbar and a sidebar, the navbar marks the first item whose page is in the current sidebar as active, even when a later item links to the current page.
That item also gets aria-current="page", so a screen reader announces the wrong page as current.
The loop that latches the active link breaks on the first navbar link whose href appears anywhere in the sidebar of the current page, before it checks for an exact match:
https://github.com/quarto-dev/quarto-cli/blob/1d80652ba64516c46173120048892c6694be9fb6/src/project/types/website/website-navigation.ts#L558-L576
When "Home" and "Get started" both link to pages of the same sidebar, "Home" wins on every page of that sidebar.
Issue #9277 reports the same loop picking "Home" when the sidebar has a logo.
Related: #9277, #15190, #15191.
Steps to reproduce
_quarto.yml:
project:
type: website
website:
title: "Repro"
navbar:
left:
- href: index.qmd
text: Home
- href: get-started.qmd
text: Get started
sidebar:
style: docked
contents:
- index.qmd
- get-started.qmd
format: html
index.qmd:
---
title: Home
---
Home.
get-started.qmd:
---
title: Get started
---
Get started.
Run quarto render, then open _site/get-started.html.
Actual behavior
On get-started.html, the navbar renders:
<a class="nav-link active" href="./index.html" aria-current="page">
<a class="nav-link" href="./get-started.html">
Expected behavior
The link to the current page is active and has aria-current="page":
<a class="nav-link" href="./index.html">
<a class="nav-link active" href="./get-started.html" aria-current="page">
An exact match should win over a sidebar match.
When only a sidebar match exists, the link marks a section, not the page, so aria-current="true" fits better than "page".
Your environment
- IDE: none, command line.
- OS: macOS 27.2.
Quarto check output
Quarto 99.9.9
[✓] Checking environment information...
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.13.0: OK
Dart Sass version 1.107.1: OK
Deno version 2.9.8: OK
Typst version 0.15.1: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 99.9.9
commit: 1d80652ba64516c46173120048892c6694be9fb6
- 主要言語
- JavaScript
- スター
- 6.2k
- フォーク
- 492
- 平均マージ
- 15時間 15分
- マージ済み PR(30日)
- 94
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
quarto-dev/quarto-cli のほかの issue
-
bootstrap enhancement themes
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
quarto-dev/quarto-cli#15421 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
quarto-dev/quarto-cli#15408 ·
メンテナーはふだん 1 日以内に返信
-
accessibility bug
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
quarto-dev/quarto-cli#15401 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug callouts docx regression
難易度 2/5 1〜3時間 初心者へのやさしさ 81/100
quarto-dev/quarto-cli#15394 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
bug lightbox
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
quarto-dev/quarto-cli#15393 ·
メンテナーはふだん 1 日以内に返信
quarto-dev/quarto-cli の issue をすべて見る
似ている issue
-
bug help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
LangerSword/gitone#7 ·
-
good first issue reliability security should-have
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 13 日以内に返信
-
[BUG]: chunkSource protocol stripping truncates URLs or reads an inner scheme対応中かも @Bensonbenyi が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
Mintplex-Labs/anything-llm#7338 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信