@@ -16,14 +16,11 @@ import EditorPane from "@/components/EditorPane";
1616import PreviewPane from "@/components/PreviewPane" ;
1717import AIPanel from "@/components/AIPanel" ;
1818import StatusBar from "@/components/StatusBar" ;
19- import RecentFilesMenu from "@/components/RecentFilesMenu" ;
20- import { Files } from "@/lib/api" ;
2119
2220export default function HomePage ( ) {
2321 const editor = useEditor ( ) ;
24- const [ showPreview , setShowPreview ] = useState ( true ) ;
22+ const [ showPreview ] = useState ( true ) ;
2523 const [ showAIPanel , setShowAIPanel ] = useState ( false ) ;
26- const [ showRecent , setShowRecent ] = useState ( false ) ;
2724 const monacoRef = useRef < MonacoEditor . IStandaloneCodeEditor | null > ( null ) ;
2825
2926 // Load recent files on mount and initialise preview
@@ -61,13 +58,8 @@ export default function HomePage() {
6158 if ( ! file ) return ;
6259 // For browser mode read directly; for Tauri we'd have a native path
6360 const text = await file . text ( ) ;
64- const name = file . name ;
65- // In pure browser we don't have an absolute path — use the filename as label
66- const id = `tab-upload-${ Date . now ( ) } ` ;
67- editor . newTab ( ) ;
68- setTimeout ( ( ) => {
69- editor . handleContentChange ( text ) ;
70- } , 0 ) ;
61+ // In pure browser we don't have an absolute path — use filename as tab label.
62+ editor . openTextAsTab ( file . name , text , null ) ;
7163 e . target . value = "" ;
7264 } ;
7365
0 commit comments