Fix RightNav elements focus outline on web (#8788)

This commit is contained in:
Bartosz Kaszubowski
2025-08-26 21:43:25 +02:00
committed by GitHub
parent 8dcf1825ec
commit 0555d3623c
3 changed files with 22 additions and 4 deletions
+16 -3
View File
@@ -4,7 +4,7 @@ import {useLingui} from '@lingui/react'
import {useNavigation, useNavigationState} from '@react-navigation/native' import {useNavigation, useNavigationState} from '@react-navigation/native'
import {getCurrentRoute} from '#/lib/routes/helpers' import {getCurrentRoute} from '#/lib/routes/helpers'
import {NavigationProp} from '#/lib/routes/types' import {type NavigationProp} from '#/lib/routes/types'
import {emitSoftReset} from '#/state/events' import {emitSoftReset} from '#/state/events'
import {usePinnedFeedsInfos} from '#/state/queries/feed' import {usePinnedFeedsInfos} from '#/state/queries/feed'
import {useSelectedFeed, useSetSelectedFeed} from '#/state/shell/selected-feed' import {useSelectedFeed, useSetSelectedFeed} from '#/state/shell/selected-feed'
@@ -30,7 +30,8 @@ export function DesktopFeeds() {
<View <View
style={[ style={[
{ {
gap: 12, gap: 10,
paddingVertical: 2,
}, },
]}> ]}>
{Array(5) {Array(5)
@@ -66,6 +67,7 @@ export function DesktopFeeds() {
* height of the screen with lots of feeds. * height of the screen with lots of feeds.
*/ */
paddingVertical: 2, paddingVertical: 2,
marginHorizontal: -2,
overflowY: 'auto', overflowY: 'auto',
}), }),
]}> ]}>
@@ -90,6 +92,10 @@ export function DesktopFeeds() {
current current
? [a.font_bold, t.atoms.text] ? [a.font_bold, t.atoms.text]
: [t.atoms.text_contrast_medium], : [t.atoms.text_contrast_medium],
web({
marginHorizontal: 2,
width: 'calc(100% - 4px)',
}),
]} ]}
numberOfLines={1}> numberOfLines={1}>
{feedInfo.displayName} {feedInfo.displayName}
@@ -100,7 +106,14 @@ export function DesktopFeeds() {
<InlineLinkText <InlineLinkText
to="/feeds" to="/feeds"
label={_(msg`More feeds`)} label={_(msg`More feeds`)}
style={[a.text_md, a.leading_snug]} style={[
a.text_md,
a.leading_snug,
web({
marginHorizontal: 2,
width: 'calc(100% - 4px)',
}),
]}
numberOfLines={1}> numberOfLines={1}>
{_(msg`More feeds`)} {_(msg`More feeds`)}
</InlineLinkText> </InlineLinkText>
+5 -1
View File
@@ -65,6 +65,7 @@ export function DesktopRightNav({routeName}: {routeName: string}) {
style={[ style={[
gutters, gutters,
a.gap_lg, a.gap_lg,
a.pr_2xs,
web({ web({
position: 'fixed', position: 'fixed',
left: '50%', left: '50%',
@@ -74,7 +75,10 @@ export function DesktopRightNav({routeName}: {routeName: string}) {
}, },
...a.scrollbar_offset.transform, ...a.scrollbar_offset.transform,
], ],
width: width + gutters.paddingLeft, /**
* Compensate for the right padding above (2px) to retain intended width.
*/
width: width + gutters.paddingLeft + 2,
maxHeight: '100%', maxHeight: '100%',
overflowY: 'auto', overflowY: 'auto',
}), }),
@@ -82,6 +82,7 @@ function Inner() {
<TrendingTopicLink <TrendingTopicLink
key={topic.link} key={topic.link}
topic={topic} topic={topic}
style={a.rounded_full}
onPress={() => { onPress={() => {
logEvent('trendingTopic:click', {context: 'sidebar'}) logEvent('trendingTopic:click', {context: 'sidebar'})
}}> }}>