Pin the new tab button outside the tab scroll view (#7292)

Move the "New tab" button out of ScrollView so that it remains visible
and reachable regardless of how far the tabs have been scrolled.
This commit is contained in:
Jinjing 2026-07-03 19:38:24 -07:00 committed by GitHub
parent 29c7fa7a03
commit bdb6d144c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 20 additions and 21 deletions

View File

@ -4571,28 +4571,27 @@ export default function SessionScreen() {
</View>
</Pressable>
))}
<Pressable
style={({ pressed }) => [
styles.newTerminalButton,
pressed && styles.newTerminalButtonPressed,
(creating ||
creatingBrowser ||
creatingMarkdown ||
connState !== 'connected') &&
styles.newTerminalButtonDisabled
]}
disabled={
creating || creatingBrowser || creatingMarkdown || connState !== 'connected'
}
onPress={() => {
setCreateError('')
setShowCreateTabDrawer(true)
}}
accessibilityLabel="New tab"
>
<Plus size={16} color={colors.textSecondary} strokeWidth={2.2} />
</Pressable>
</ScrollView>
{/* Why: pinned outside the scroll strip so the new-agent button
stays reachable no matter how far the tabs scroll. */}
<Pressable
style={({ pressed }) => [
styles.newTerminalButton,
pressed && styles.newTerminalButtonPressed,
(creating || creatingBrowser || creatingMarkdown || connState !== 'connected') &&
styles.newTerminalButtonDisabled
]}
disabled={
creating || creatingBrowser || creatingMarkdown || connState !== 'connected'
}
onPress={() => {
setCreateError('')
setShowCreateTabDrawer(true)
}}
accessibilityLabel="New tab"
>
<Plus size={16} color={colors.textSecondary} strokeWidth={2.2} />
</Pressable>
</View>
)}
</SafeAreaView>