this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Extract out the fancy selector string

+8 -9
+8 -9
src/pages/status.jsx
··· 60 60 behavior: 'smooth', 61 61 }; 62 62 63 + // Select all statuses except those inside collapsed details/summary 64 + // Hat-tip to @AmeliaBR@front-end.social 65 + // https://front-end.social/@AmeliaBR/109784776146144471 66 + const STATUSES_SELECTOR = 67 + '.status-link:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *), .status-focus:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *)'; 68 + 63 69 function StatusPage(params) { 64 70 const { id } = params; 65 71 const { masto, instance } = api({ instance: params.instance }); ··· 555 561 ); 556 562 const activeStatusRect = activeStatus?.getBoundingClientRect(); 557 563 const allStatusLinks = Array.from( 558 - // Select all statuses except those inside collapsed details/summary 559 - // Hat-tip to @AmeliaBR@front-end.social 560 - // https://front-end.social/@AmeliaBR/109784776146144471 561 - scrollableRef.current.querySelectorAll( 562 - '.status-link:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *), .status-focus:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *)', 563 - ), 564 + scrollableRef.current.querySelectorAll(STATUSES_SELECTOR), 564 565 ); 565 566 console.log({ allStatusLinks }); 566 567 if ( ··· 593 594 ); 594 595 const activeStatusRect = activeStatus?.getBoundingClientRect(); 595 596 const allStatusLinks = Array.from( 596 - scrollableRef.current.querySelectorAll( 597 - '.status-link:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *), .status-focus:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *)', 598 - ), 597 + scrollableRef.current.querySelectorAll(STATUSES_SELECTOR), 599 598 ); 600 599 if ( 601 600 activeStatus &&