Feat/improve cache load state (#118)

* Fix auth logout redirect and add tree node spacing

* Remove app loader animation and related cleanup

Removes custom app loader UI from index.html and useEffect in App.tsx that handled loader fade-out transition
This commit is contained in:
Chris Scott authored and GitHub committed 2026-02-08 14:20:55 -05:00
1 parent bfe7954825
commit 6b30d13124
4 files changed
+11 -45

No files matched your search

-29
View File
@@ -15,35 +15,6 @@
</head>
<body>
<div id="root"></div>
<div id="app-loader" style="
position: absolute;
top: 0;
left: 0;
width: 100%;
min-height: calc(100% + env(safe-area-inset-top));
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 24px;
background: #000;
z-index: 9999;
">
<img src="/opencode-wordmark-dark.svg" alt="OpenCode" style="height: 42px; width: auto;" />
<div style="
width: 24px;
height: 24px;
border: 2px solid rgba(255,255,255,0.1);
border-top-color: rgba(255,255,255,0.8);
border-radius: 50%;
animation: app-loader-spin 0.8s linear infinite;
"></div>
</div>
<style>
@keyframes app-loader-spin {
to { transform: rotate(360deg); }
}
</style>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
+1 -10
View File
@@ -1,4 +1,4 @@
import { useEffect } from 'react'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { createBrowserRouter, RouterProvider, Outlet } from 'react-router-dom'
import { Toaster } from 'sonner'
@@ -63,15 +63,6 @@ function PermissionDialogWrapper() {
function AppShell() {
useTheme()
useEffect(() => {
const loader = document.getElementById('app-loader')
if (loader) {
loader.style.transition = 'opacity 0.2s ease-out'
loader.style.opacity = '0'
setTimeout(() => loader.remove(), 200)
}
}, [])
return (
<AuthProvider>
<EventProvider>
@@ -136,7 +136,7 @@ function TreeNode({ file, level, onFileSelect, onDirectoryClick, selectedFile, o
return (
<div>
<div
className={`flex items-center gap-1 px-2 py-1 hover:bg-muted rounded cursor-pointer group ${
className={`flex items-center gap-1 px-2 py-1 mb-4 hover:bg-muted rounded cursor-pointer group ${
selectedFile?.path === file.path ? 'bg-muted' : ''
}`}
style={{ paddingLeft: `${level * 16 + 8}px` }}
@@ -285,4 +285,4 @@ export const FileTree = memo(function FileTree({ files, onFileSelect, onDirector
)}
</div>
)
})
})
+8 -4
View File
@@ -112,10 +112,14 @@ export function AuthProvider({ children }: AuthProviderProps) {
}, [])
const logout = useCallback(async () => {
await signOut()
await refetch()
navigate('/login', { replace: true })
}, [refetch, navigate])
await signOut({
fetchOptions: {
onSuccess: () => {
window.location.href = '/login'
},
},
})
}, [])
const refreshSession = useCallback(async () => {
await refetch()