[Sistent] In-page navigation is empty on Getting Started > About; `IntraPage` ignores the `contents` prop it is passed
I maintainer di solito rispondono entro 2 giorni
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 86/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript
- Ambito
- frontend
Direzione di ricerca
Inizia da src/components/SistentNavigation/intra-page.js:62 e confrontalo con src/components/handbook-navigation/intra-page.js:42, quindi esamina l’elenco dei contenuti e la chiamata in src/sections/Projects/Sistent/getting-started/about/index.js. Conferma che l’approccio scelto preservi anche la chiamata senza props in SistentLayout e che la navigazione della pagina About elenchi le relative sezioni con ancora e vi conduca.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
https://layer5.io/projects/sistent/getting-started/about renders its right-hand "on this page" navigation as an empty list, even though the page has three anchored sections.
The cause is a mismatch between IntraPage and its caller.
src/components/SistentNavigation/intra-page.js:62 declares the component with no props and derives its list from the DOM instead:
function IntraPage() {
const [contents, setContents] = useState([]);
useEffect(() => {
const anchors = document.querySelectorAll(".main-content > a");
...
}, []);
But src/sections/Projects/Sistent/getting-started/about/index.js builds an explicit list and passes it in:
// line 13
const contents = [{ id: 0, link: "#About Sistent", text: "About Sistent" }];
// line 277
<IntraPage contents={contents} />
The prop is silently discarded. The DOM query is then the only source of entries, and it looks for anchors that are direct children of .main-content — a wrapper that exists only in src/templates/sistent-component.js:71, i.e. only on the MDX-driven component documentation pages. The About page has no .main-content element, so the query matches nothing and the list renders empty.
The About page does have anchors that a working implementation would pick up, at lines 40 (<a id="About Sistent">), 89 (<a id="Installation">), and 113 (<a id="Using local Sistent">) — note that the hand-written contents array only lists the first of the three, so the two sources disagree about what the nav should contain.
For contrast, src/components/handbook-navigation/intra-page.js:42 implements the same UI as function IntraPage({ contents }), correctly consuming the prop.
Expected Behavior
The About page's in-page navigation lists its sections and lets the reader jump to them, consistent with the component documentation pages.
Either approach works, as long as the component and its caller agree:
- Accept a
contentsprop and fall back to the DOM scan when it is absent — this preserves both call sites, includingSistentLayout's prop-less<IntraPage />; or - Keep the DOM scan as the single source of truth, widen the selector so it matches the anchors on non-template pages, and delete the now-dead
contentsarray from the About page.
Option 1 matches the existing handbook implementation and is the smaller change.
Two related issues were closed previously without covering this case: #5516 (positioning of the section navigator) and #5154 (removing an unused intra-page link).
Screenshots
N/A — visible as an empty column on the right of https://layer5.io/projects/sistent/getting-started/about at viewport widths above 1280px.
Environment:
- Host OS: any
- Browser: any
- Lingua principale
- JavaScript
- Stelle
- 1.1k
- Fork
- 1.7k
- Merge medio
- 4g 23h
- PR unite (30g)
- 27
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di layer5io/layer5
-
[UI] Contact us (mail use mailchimp)is not responsive on iphone 16(393 x 852).Forse già presa @SakshamMawari l’ha presa 3 giorni fa. Apertaframework/gatsby help wanted kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
layer5io/layer5#8197 · 3 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
[About] "Who Are We?" section overlaps and overflows on mobile and tablet widthsForse già presa @ayushgade06 l’ha presa 4 giorni fa. Apertaframework/gatsby help wanted kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
layer5io/layer5#8194 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
[Meshery] Improve Integrations Honeycomb spacing and icon consistencyForse già presa @priyanshuuu777 l’ha presa 10 giorni fa. Apertaframework/gatsby help wanted kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
layer5io/layer5#8187 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
Unwanted white border and white box on "Join the Conversation" (Discuss) card on Learn, Community & FAQ pagesForse già presa @ayushgade06 l’ha presa 17 giorni fa. Apertaframework/gatsby help wanted kind/bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
layer5io/layer5#8158 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
[UI]: "Learn more →" link misaligned on mobile/responsive view of Cloud Native Deployments by Diagram pageForse già presa @nakul-git139 l’ha presa 12 giorni fa. Apertaframework/gatsby help wanted kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
layer5io/layer5#8155 · 4 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di layer5io/layer5
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
keyxmakerx/Chronicle#1532 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement feature good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
bug lsp sev-3
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
Miaotofu01/Study-Mate#206 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
Uuriko/project-room#3998 ·
I maintainer di solito rispondono entro 1 giorno