Expand AITURK Turkish settings and desktop surfaces for beta 5

This commit is contained in:
yilsem committed 2026-09-06 05:03:32 +03:00
1 parent 237d1e2060
commit 5e76f58637
108 files changed
+6675 -1034

No files matched your search

+16 -6
View File
@@ -11,6 +11,7 @@ import { lazy, type ReactNode, Suspense } from 'react'
import { ContribBoundary, ContribRender } from '@/contrib/react/boundary'
import { useContributions } from '@/contrib/react/use-contributions'
import { translateNow, type Translations, useI18n } from '@/i18n'
import { $routeTiles, closeRouteTile, type RouteTile } from '@/store/route-tiles'
import { ARTIFACTS_ROUTE, contributedRoutes, MESSAGING_ROUTE, ROUTES_AREA, SKILLS_ROUTE } from '../routes'
@@ -22,10 +23,10 @@ const MessagingView = lazy(async () => ({ default: (await import('../messaging')
const ArtifactsView = lazy(async () => ({ default: (await import('../artifacts')).ArtifactsView }))
// Built-in page views + their pane titles, keyed by route.
const BUILTIN_PAGES: Record<string, { render: () => ReactNode; title: string }> = {
[ARTIFACTS_ROUTE]: { render: () => <ArtifactsView />, title: 'Artifacts' },
[MESSAGING_ROUTE]: { render: () => <MessagingView />, title: 'Messaging' },
[SKILLS_ROUTE]: { render: () => <SkillsView />, title: 'Capabilities' }
const BUILTIN_PAGES: Record<string, { render: () => ReactNode; titleKey: keyof Translations['sidebar']['nav'] }> = {
[ARTIFACTS_ROUTE]: { render: () => <ArtifactsView />, titleKey: 'artifacts' },
[MESSAGING_ROUTE]: { render: () => <MessagingView />, titleKey: 'messaging' },
[SKILLS_ROUTE]: { render: () => <SkillsView />, titleKey: 'skills' }
}
/** Humanize a route path into a tab title: `/my-atlas` → `My Atlas`. */
@@ -41,13 +42,21 @@ const humanizePath = (path: string): string =>
* else a humanized path — never the internal `${source}:${id}` key. */
function routeTitle(path: string): string {
if (BUILTIN_PAGES[path]) {
return BUILTIN_PAGES[path].title
return translateNow(`sidebar.nav.${BUILTIN_PAGES[path].titleKey}`)
}
return contributedRoutes().find(r => r.path === path)?.title ?? humanizePath(path)
}
function RouteTileTitle({ path }: { path: string }) {
const { t } = useI18n()
const builtin = BUILTIN_PAGES[path]
return <>{builtin ? t.sidebar.nav[builtin.titleKey] : routeTitle(path)}</>
}
function RouteTilePane({ path }: { path: string }) {
const { t } = useI18n()
const builtin = BUILTIN_PAGES[path]
// Subscribe so a plugin page tile appears the moment its route registers.
@@ -74,7 +83,7 @@ function RouteTilePane({ path }: { path: string }) {
return (
<div className="grid h-full place-items-center font-mono text-[11px] text-(--ui-text-quaternary)">
no page at {path}
{t.surfaces.noPage(path)}
</div>
)
}
@@ -91,6 +100,7 @@ export const watchRouteTiles = paneMirror<RouteTile>({
dir: t => t.dir,
minWidth: '22rem',
title: routeTitle,
tabTitle: path => <RouteTileTitle path={path} />,
render: path => <RouteTilePane path={path} />,
close: closeRouteTile
})