Resolves which tab-icon variant a web view tab should show, given the current theme and this
tab's live selected state.
The tab icon is painted by the platform as a static CSS background-image, so a currentColor
SVG can't follow the theme or selection state — callers must swap the actual icon URL. "Selected"
here means this tab is the active one in its group: rc-dock renders exactly one tab's pane at a
time, hiding the rest with display: none, so "my pane is currently visible" and "I'm the
selected tab" are the same condition — this reuses useViewVisibility's event-driven
IntersectionObserver detection rather than polling frameElement.offsetParent on an interval.
pickTabIconUrl's undefined ("selection unknown") case is effectively unreachable through this
call site, since useViewVisibility resolves synchronously on first render with no unknown
window, but pickTabIconUrl keeps accepting it as a standalone, independently-testable
function.
Callers own the theme subscription themselves (e.g. papi.themes.subscribeCurrentTheme) and pass
the resulting isDarkTheme in — this hook has no PAPI dependency.
Resolves which tab-icon variant a web view tab should show, given the current theme and this tab's live selected state.
The tab icon is painted by the platform as a static CSS
background-image, so acurrentColorSVG can't follow the theme or selection state — callers must swap the actual icon URL. "Selected" here means this tab is the active one in its group: rc-dock renders exactly one tab's pane at a time, hiding the rest withdisplay: none, so "my pane is currently visible" and "I'm the selected tab" are the same condition — this reusesuseViewVisibility's event-drivenIntersectionObserverdetection rather than pollingframeElement.offsetParenton an interval.pickTabIconUrl'sundefined("selection unknown") case is effectively unreachable through this call site, sinceuseViewVisibilityresolves synchronously on first render with no unknown window, butpickTabIconUrlkeeps accepting it as a standalone, independently-testable function.Callers own the theme subscription themselves (e.g.
papi.themes.subscribeCurrentTheme) and pass the resultingisDarkThemein — this hook has no PAPI dependency.