-
Notifications
You must be signed in to change notification settings - Fork 0
Window menu 적용 및 Settings window 생성 #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
928d5ec
feat: 타우리 window menu 기본 설정
Bori-github 12774c0
chore: react-router-dom 패키지 추가
Bori-github 7d76d35
feat: window menu settings 클릭 시 새 window 창 생성 및 settings 페이지로 라우팅 처리
Bori-github 0c9e9ed
feat: 설정 창을 위한 설정 페이지 생성 및 탭 선택 시 탭 제목 변경 기능 적용
Bori-github 50555cc
fix: window.set_title not allowed 권한 에러 수정을 위한 설정 추가
Bori-github c6db01e
fix: format rust
Bori-github 3bf88a1
chore: 탭 클릭 시 getCurrentWindow 재호출 하지 않도록 처리
Bori-github 6af2a29
chore: 불필요한 주석 제거
Bori-github f36e6fa
chore: 잘못된 에러처리 수정
Bori-github d8c9388
fix: format rust
Bori-github File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "$schema": "../gen/schemas/desktop-schema.json", | ||
| "identifier": "main", | ||
| "windows": ["main", "settings"], | ||
| "permissions": [ | ||
| "core:window:allow-set-title" | ||
| ] | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,8 @@ | |
| } | ||
| ], | ||
| "security": { | ||
| "csp": null | ||
| "csp": null, | ||
| "capabilities": ["main"] | ||
| } | ||
| }, | ||
| "bundle": { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,12 @@ | ||
| import React from 'react'; | ||
|
|
||
| import { Providers } from './providers'; | ||
| import { PlaygroundPage } from '../pages/playground'; | ||
| import { Router } from './router'; | ||
|
|
||
| export const App: React.FC = () => { | ||
| return ( | ||
| <Providers> | ||
| <PlaygroundPage /> | ||
| <Router /> | ||
| </Providers> | ||
| ); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import { BrowserRouter, Routes, Route } from 'react-router-dom'; | ||
|
|
||
| import { PlaygroundPage } from '@/pages/playground'; | ||
| import { SettingsPage } from '@/pages/settings'; | ||
|
|
||
| export const Router = () => { | ||
| return ( | ||
| <BrowserRouter> | ||
| <Routes> | ||
| <Route path="/" element={<PlaygroundPage />} /> | ||
| <Route path="/settings" element={<SettingsPage />} /> | ||
| </Routes> | ||
| </BrowserRouter> | ||
| ); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export { SettingsPage } from './settings-page'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| import React, { useRef, useState } from 'react'; | ||
| import { getCurrentWindow, Window } from '@tauri-apps/api/window'; | ||
|
|
||
| type SettingsTab = | ||
| | 'general' | ||
| | 'build' | ||
| | 'formatting' | ||
| | 'appearance' | ||
| | 'ai' | ||
| | 'advanced'; | ||
|
|
||
| const TAB_TITLES: Record<SettingsTab, string> = { | ||
| general: 'General', | ||
| build: 'Build', | ||
| formatting: 'Formatting', | ||
| appearance: 'Appearance', | ||
| ai: 'AI', | ||
| advanced: 'Advanced', | ||
| }; | ||
|
|
||
| const TABS: { id: SettingsTab; label: string }[] = [ | ||
| { id: 'general', label: 'General' }, | ||
| { id: 'build', label: 'Build' }, | ||
| { id: 'formatting', label: 'Formatting' }, | ||
| { id: 'appearance', label: 'Appearance' }, | ||
| { id: 'ai', label: 'AI' }, | ||
| { id: 'advanced', label: 'Advanced' }, | ||
| ]; | ||
|
|
||
| export const SettingsPage: React.FC = () => { | ||
| const windowRef = useRef<Window>(getCurrentWindow()); | ||
|
|
||
| const [activeTab, setActiveTab] = useState<SettingsTab>('general'); | ||
|
|
||
| const updateWindowTitle = async (tabId: SettingsTab) => { | ||
| try { | ||
| await windowRef.current.setTitle(TAB_TITLES[tabId]); | ||
| } catch (error) { | ||
| console.error('창 제목 변경 실패:', error); | ||
Bori-github marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| }; | ||
|
|
||
| const handleTabClick = async (tabId: SettingsTab) => { | ||
| setActiveTab(tabId); | ||
|
|
||
| await updateWindowTitle(tabId); | ||
| }; | ||
|
|
||
| return ( | ||
| <div className="flex h-screen bg-gray-900 text-white"> | ||
| {/* 사이드바 */} | ||
| <div className="w-48 border-r border-gray-700 bg-gray-800"> | ||
| <div className="p-4 border-b border-gray-700"> | ||
| <h1 className="text-xl font-bold">Settings</h1> | ||
| </div> | ||
| <nav className="p-2"> | ||
| {TABS.map((tab) => ( | ||
| <button | ||
| key={tab.id} | ||
| onClick={() => handleTabClick(tab.id)} | ||
| className={`w-full text-left px-4 py-2 rounded-md mb-1 transition-colors ${ | ||
| activeTab === tab.id | ||
| ? 'bg-blue-600 text-white' | ||
| : 'text-gray-300 hover:bg-gray-700' | ||
| }`} | ||
| > | ||
| {tab.label} | ||
| </button> | ||
| ))} | ||
| </nav> | ||
| </div> | ||
|
|
||
| {/* 컨텐츠 영역 */} | ||
| <div className="flex-1 overflow-y-auto p-8"> | ||
| {activeTab === 'general' && ( | ||
| <div> | ||
| <h2 className="text-2xl font-bold mb-6">General</h2> | ||
| <p className="text-gray-400">일반 설정 옵션이 여기에 추가됩니다.</p> | ||
| </div> | ||
| )} | ||
|
|
||
| {activeTab === 'build' && ( | ||
| <div> | ||
| <h2 className="text-2xl font-bold mb-6">Build</h2> | ||
| <p className="text-gray-400">빌드 설정 옵션이 여기에 추가됩니다.</p> | ||
| </div> | ||
| )} | ||
|
|
||
| {activeTab === 'formatting' && ( | ||
| <div> | ||
| <h2 className="text-2xl font-bold mb-6">Formatting</h2> | ||
| <p className="text-gray-400"> | ||
| 포맷팅 설정 옵션이 여기에 추가됩니다. | ||
| </p> | ||
| </div> | ||
| )} | ||
|
|
||
| {activeTab === 'appearance' && ( | ||
| <div> | ||
| <h2 className="text-2xl font-bold mb-6">Appearance</h2> | ||
| <p className="text-gray-400">외관 설정 옵션이 여기에 추가됩니다.</p> | ||
| </div> | ||
| )} | ||
|
|
||
| {activeTab === 'ai' && ( | ||
| <div> | ||
| <h2 className="text-2xl font-bold mb-6">AI</h2> | ||
| <p className="text-gray-400">AI 설정 옵션이 여기에 추가됩니다.</p> | ||
| </div> | ||
| )} | ||
|
|
||
| {activeTab === 'advanced' && ( | ||
| <div> | ||
| <h2 className="text-2xl font-bold mb-6">Advanced</h2> | ||
| <p className="text-gray-400">고급 설정 옵션이 여기에 추가됩니다.</p> | ||
| </div> | ||
| )} | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.