feat(app): add inline file browser tabs (#35829)
This commit is contained in:
@@ -172,6 +172,14 @@ function createScrollSync(input: { tab: () => string; view: ReturnType<typeof us
|
||||
}
|
||||
|
||||
export function FileTabContent(props: { tab: string }) {
|
||||
return (
|
||||
<Tabs.Content value={props.tab}>
|
||||
<SessionFileView tab={props.tab} />
|
||||
</Tabs.Content>
|
||||
)
|
||||
}
|
||||
|
||||
export function SessionFileView(props: { tab: string }) {
|
||||
const file = useFile()
|
||||
const comments = useComments()
|
||||
const language = useLanguage()
|
||||
@@ -439,8 +447,8 @@ export function FileTabContent(props: { tab: string }) {
|
||||
</div>
|
||||
)
|
||||
|
||||
return (
|
||||
<Tabs.Content value={props.tab} class="mt-3 relative h-full">
|
||||
const content = () => (
|
||||
<div class="mt-3 relative h-full min-h-0">
|
||||
<ScrollView class="h-full" viewportRef={scrollSync.setViewport} onScroll={scrollSync.handleScroll as any}>
|
||||
<Switch>
|
||||
<Match when={state()?.loaded}>{renderFile(contents())}</Match>
|
||||
@@ -450,6 +458,8 @@ export function FileTabContent(props: { tab: string }) {
|
||||
<Match when={state()?.error}>{(err) => <div class="px-6 py-4 text-text-weak">{err()}</div>}</Match>
|
||||
</Switch>
|
||||
</ScrollView>
|
||||
</Tabs.Content>
|
||||
</div>
|
||||
)
|
||||
|
||||
return content()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user