Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions plugins/shared/MirrorBrowser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,9 @@ export function MirrorBrowser(props: {
color: props.theme().colors.text,
placeholderColor: props.theme().colors.muted,
...props.theme().type.body,
...(touch || platform.idiom === 'phone' || platform.idiom === 'pad'
? { fontSize: 16, lineHeight: 22 }
: {}),
}}
focusStyle={
terminal
Expand Down
6 changes: 5 additions & 1 deletion products/maka/web-nsh/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { cleanup, mount, Scroll, signal, Text, View } from 'nsh';
import { cleanup, keyboardFrame, mount, safeArea, Scroll, signal, Text, View } from 'nsh';

import { initializeAppearance } from '../workbench/app/appearance';
import { PANEL_INSET } from '../workbench/app/chrome';
Expand Down Expand Up @@ -318,6 +318,10 @@ export default function App() {
minHeight: 0,
flexDirection: isCompact() ? 'column' : 'row',
backgroundColor: C.chrome,
paddingTop: safeArea().top,
paddingLeft: safeArea().left,
paddingRight: safeArea().right,
paddingBottom: Math.max(safeArea().bottom, keyboardFrame().height),
}}
>
<If
Expand Down
9 changes: 6 additions & 3 deletions products/maka/web-nsh/src/views/SignInView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { Scroll, signal, Text, View } from 'nsh';
import { keyboardFrame, safeArea, Scroll, signal, Text, View, windowSize } from 'nsh';
import { parseServerInviteLink } from '../../../../../plugins/shared/makaServer.ts';
import { Icon } from '../../../workbench/app/Icon';
import { tr } from '../../../workbench/app/locale';
Expand Down Expand Up @@ -158,7 +158,10 @@ export function SignInView(props: {
flexGrow: 1,
alignItems: 'center',
justifyContent: 'center',
padding: 20,
paddingTop: 20 + safeArea().top,
paddingLeft: (windowSize().width < 520 ? 12 : 20) + safeArea().left,
paddingRight: (windowSize().width < 520 ? 12 : 20) + safeArea().right,
paddingBottom: 20 + Math.max(safeArea().bottom, keyboardFrame().height),
}}
>
<View
Expand All @@ -169,7 +172,7 @@ export function SignInView(props: {
borderRadius: radius(12),
borderWidth: lineWidth(),
borderColor: C.lineSoft,
padding: 24,
padding: windowSize().width < 520 ? 16 : 24,
gap: 20,
}}
>
Expand Down
4 changes: 2 additions & 2 deletions products/maka/workbench/app/Automations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ function SessionPicker(props: {
>
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 6 }}>
<Input
autoFocus
autoFocus={platform.idiom !== 'phone' && platform.idiom !== 'pad'}
accessibilityLabel={tr('Search conversations…')}
value={query()}
placeholder={tr('Search conversations…')}
Expand Down Expand Up @@ -763,7 +763,7 @@ function TimeZonePicker(props: {
}
>
<Input
autoFocus
autoFocus={platform.idiom !== 'phone' && platform.idiom !== 'pad'}
value={query()}
placeholder={tr('Search time zone…')}
onChange={({ value }) => query.set(value)}
Expand Down
17 changes: 14 additions & 3 deletions products/maka/workbench/app/ChangesStudio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,18 @@
*/

import { formatCount } from './numberFormat';
import { cleanup, computed, effect, Scroll, signal, Text, untracked, View, windowSize } from 'nsh';
import {
cleanup,
computed,
effect,
platform,
Scroll,
signal,
Text,
untracked,
View,
windowSize,
} from 'nsh';
import {
DiffView,
type DiffAnnotation,
Expand Down Expand Up @@ -1577,7 +1588,7 @@ export function ChangesStudio(props: {
<View style={{ ...menuRowStyle(), gap: 8, flexShrink: 0 }}>
<Icon name="search" size={14} color={C.muted} />
<Input
autoFocus
autoFocus={platform.idiom !== 'phone' && platform.idiom !== 'pad'}
value={branchSearch()}
onChange={({ value }) => branchSearch.set(value)}
placeholder={tr('Filter branches…')}
Expand Down Expand Up @@ -1704,7 +1715,7 @@ export function ChangesStudio(props: {
<View style={{ ...menuRowStyle(), gap: 8, flexShrink: 0 }}>
<Icon name="search" size={14} color={C.muted} />
<Input
autoFocus
autoFocus={platform.idiom !== 'phone' && platform.idiom !== 'pad'}
value={commitSearch()}
onChange={({ value }) => commitSearch.set(value)}
placeholder={tr('Filter commits…')}
Expand Down
12 changes: 10 additions & 2 deletions products/maka/workbench/app/ModalDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

import {
cleanup,
keyboardFrame,
platform,
safeArea,
signal,
Text,
untracked,
Expand Down Expand Up @@ -80,6 +82,8 @@ export function ModalDialog(props: {
outside?: JSX.Element;
children: JSX.Element;
}) {
const insets = () => safeArea();
const bottomInset = () => Math.max(insets().bottom, keyboardFrame().height);
return (
<WindowDialog
animation="none"
Expand All @@ -96,9 +100,13 @@ export function ModalDialog(props: {
flex: 1,
justifyContent: props.launcher ? 'flex-start' : 'center',
alignItems: 'center',
padding: 16,
paddingLeft: 16 + insets().left,
paddingRight: 16 + insets().right,
paddingBottom: 16 + bottomInset(),
paddingTop:
props.launcher && windowSize().height >= 480 ? windowSize().height / 8 : dialogTop(16),
(props.launcher && windowSize().height >= 480
? Math.round(windowSize().height / 8)
: dialogTop(16)) + insets().top,
...(props.launcher ? { pointerEvents: 'box-none' } : { backgroundColor: C.scrim }),
}}
>
Expand Down
5 changes: 4 additions & 1 deletion products/maka/workbench/app/ModelSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ function ModelMenu(props: {
<Input
onFocus={() => searchFocused.set(true)}
onBlur={() => searchFocused.set(false)}
autoFocus
autoFocus={platform.idiom !== 'phone' && platform.idiom !== 'pad'}
accessibilityLabel={tr('Search models and sources')}
value={query()}
readonly={saving()}
Expand All @@ -530,6 +530,9 @@ function ModelMenu(props: {
placeholder={tr('Search models and sources…')}
style={{
...captionTextStyle,
...(platform.idiom === 'phone' || platform.idiom === 'pad'
? { fontSize: 16, lineHeight: 22 }
: {}),
flex: 1,
minWidth: 0,
color: C.text,
Expand Down
52 changes: 39 additions & 13 deletions products/maka/workbench/app/ModelSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ import {
computed,
effect,
inputAction,
keyboardFrame,
keymap,
platform,
safeArea,
Scroll,
signal,
Text,
Expand Down Expand Up @@ -557,13 +559,19 @@ export function ModelSettings(props: {
};
const wide = signal(false);
const columnMaxWidth = () => (wide() ? settingsWideColumnWidth : settingsColumnWidth);
const insets = () => safeArea();
const bottomInset = () => Math.max(insets().bottom, keyboardFrame().height);
return (
<View
style={{
flex: 1,
minHeight: 0,
flexDirection: rail() ? 'row' : 'column',
backgroundColor: terminal ? C.background : C.chrome,
paddingTop: insets().top,
paddingLeft: insets().left,
paddingRight: insets().right,
paddingBottom: bottomInset(),
}}
>
<If
Expand All @@ -578,20 +586,38 @@ export function ModelSettings(props: {
>
{narrowBackBar()}
{!terminal ? searchBox() : null}
<View
style={{
flexDirection: 'row',
flexWrap: 'wrap',
alignItems: 'center',
paddingHorizontal: 8,
paddingTop: terminal ? 0 : inlineTitleBar ? 0 : 4,
paddingBottom: terminal ? 0 : 8,
gap: terminal ? 8 : 2,
}}
<If
when={terminal}
else={
<Scroll
horizontal
style={{ flexShrink: 0 }}
contentStyle={{
flexDirection: 'row',
alignItems: 'center',
paddingHorizontal: 8,
paddingTop: inlineTitleBar ? 0 : 4,
paddingBottom: 8,
gap: 4,
}}
>
{sectionButtons()}
</Scroll>
}
>
{terminal ? backToApp(false) : null}
{sectionButtons()}
</View>
<View
style={{
flexDirection: 'row',
flexWrap: 'wrap',
alignItems: 'center',
paddingHorizontal: 8,
gap: 8,
}}
>
{backToApp(false)}
{sectionButtons()}
</View>
</If>
{terminal ? searchBox() : null}
</View>
}
Expand Down
6 changes: 3 additions & 3 deletions products/maka/workbench/app/Palette.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { tr } from './locale';
import { cleanup, computed, effect, signal, Text, View, List } from 'nsh';
import { cleanup, computed, effect, platform, signal, Text, View, List } from 'nsh';
import { Input } from 'nsh/base';
import type { ListRef, ViewStyle } from 'nsh';
import { keymap } from 'nsh';
Expand Down Expand Up @@ -102,7 +102,7 @@ export function Palette(props: {
onBlur={() => searchFocused.set(false)}
testID="palette-search"
accessibilityLabel={tr('Search commands')}
autoFocus
autoFocus={platform.idiom !== 'phone' && platform.idiom !== 'pad'}
value={query()}
onChange={({ value: text }) => {
selected.set(0);
Expand All @@ -115,7 +115,7 @@ export function Palette(props: {
placeholderColor: C.muted,
color: C.text,
height: compact() ? 32 : 40,
fontSize: fontSizes.body,
fontSize: platform.idiom === 'phone' || platform.idiom === 'pad' ? 16 : fontSizes.body,
}}
/>
</View>
Expand Down
17 changes: 14 additions & 3 deletions products/maka/workbench/app/RecallSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,18 @@
* under the License.
*/

import { batch, cleanup, computed, effect, inputAction, List, signal, Text, View } from 'nsh';
import {
batch,
cleanup,
computed,
effect,
inputAction,
List,
platform,
signal,
Text,
View,
} from 'nsh';
import { Input } from 'nsh/base';
import type { InputRef, ListRef } from 'nsh';
import { keymap } from 'nsh';
Expand Down Expand Up @@ -362,7 +373,7 @@ export function RecallSearch(props: {
onBlur={() => searchFocused.set(false)}
testID="recall-search"
accessibilityLabel={tr('Search conversation history')}
autoFocus
autoFocus={platform.idiom !== 'phone' && platform.idiom !== 'pad'}
value={query()}
onChange={({ value: text }) => search(text)}
onSubmit={submit}
Expand All @@ -376,7 +387,7 @@ export function RecallSearch(props: {
backgroundColor: C.background,
borderRadius: inputBorderRadius(),
paddingHorizontal: 12,
fontSize: fontSizes.body,
fontSize: platform.idiom === 'phone' || platform.idiom === 'pad' ? 16 : fontSizes.body,
}}
/>
<If when={state().kind === 'empty'}>
Expand Down
Loading