Adds main process bridge for GitHub Device Flow auth

Enables GitHub Device Flow authentication through the main process
to bypass CORS issues by introducing IPC bridge handlers and updating
the adapter to use them when available. Improves error handling and
logging for easier debugging. Wraps settings in a toast provider to
support user notifications.
This commit is contained in:
bincxz
2025-12-15 01:15:51 +08:00
parent f070faffee
commit e28a591554
7 changed files with 180 additions and 28 deletions

View File

@@ -2,6 +2,7 @@ import { init as initGhostty } from 'ghostty-web';
import ReactDOM from 'react-dom/client';
import App from './App';
import SettingsPage from './components/SettingsPage';
import { ToastProvider } from './components/ui/toast';
// Pre-load Ghostty WASM immediately on app start for faster terminal open
initGhostty().catch((err) => {
@@ -27,7 +28,11 @@ const root = ReactDOM.createRoot(rootElement);
const renderApp = () => {
const route = getRoute();
if (route === 'settings') {
root.render(<SettingsPage />);
root.render(
<ToastProvider>
<SettingsPage />
</ToastProvider>
);
} else {
root.render(<App />);
}
@@ -37,4 +42,4 @@ const renderApp = () => {
renderApp();
// Listen for hash changes
window.addEventListener('hashchange', renderApp);
window.addEventListener('hashchange', renderApp);