Skip to content
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

Support mutiple terminals and fix focus on terminal when opened #351

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/components/markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,9 @@ export function ChatPopup() {
{/* Subtle padding to separate content from scroll bar*/}
<div>
<div className="markdownpopup__dismiss h-8 flex flex-col mt-3 items-center">
<CommandBarActionTips tips={commandBarActionTips} />
<CommandBarActionTips tips={commandBarActionTips} />
</div>
<div className="chatpopup__content px-4 overflow-auto ">
<div className="chatpopup__content px-4 overflow-auto ">
<div className="flex flex-col space-y-2">
{markdownPopups}
</div>
Expand All @@ -367,7 +367,7 @@ export function ChatPopup() {
<CommandBar parentCaller={'chat'} />
)}
</div>
</div>
</div>
</div>
{isChatHistoryOpen && (
<ChatHistory onSelect={handleSelectHistory} />
Expand Down Expand Up @@ -761,7 +761,7 @@ function formatPromptTime(sentAt: number): string {
const hours = date.getHours()
const minutes = date.getMinutes()
const ampm = hours >= 12 ? 'pm' : 'am'
const formattedHours = hours % 12 ? 12 : hours % 12
const formattedHours = hours % 12 ? 12 : hours % 12
const formattedMinutes = minutes < 10 ? `0${minutes}` : minutes
return `${formattedHours}:${formattedMinutes}${ampm}`
}
Expand Down
49 changes: 25 additions & 24 deletions src/components/settingsPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,9 @@ export function OpenAILoginPanel({ onSubmit }: { onSubmit: () => void }) {
changeSettings({
openAIKey: localAPIKey,
useOpenAIKey: true,
openAIModel: models.at(0) ?? null
}))
openAIModel: models.at(0) ?? null,
})
)
onSubmit()
}
}, [dispatch, localAPIKey])
Expand Down Expand Up @@ -346,12 +347,12 @@ export function OpenAIPanel() {
changeSettings({
openAIKey: localAPIKey,
useOpenAIKey: true,
openAIModel: models.at(0) ?? null
}))
openAIModel: models.at(0) ?? null,
})
)
}
}, [dispatch, localAPIKey])


return (
<div className="settings__item">
<div className="settings__item_title">OpenAI API Key</div>
Expand Down Expand Up @@ -485,34 +486,36 @@ export function CursorLogin({
<div className="copilot__signin">
<button onClick={signOut}>Log out</button>
{showSettings && (
<>
<br />
<button onClick={openAccountSettings}>
Manage settings
</button>
</>
)}
<>
<br />
<button onClick={openAccountSettings}>
Manage settings
</button>
</>
)}
</div>
</div>
)
} else {
currentPanel = (
<>
<div className="settings__item">
<div className="settings__item_title">Cursor Account</div>
<div className="settings__item_title">
Cursor Account
</div>
<div className="settings__item_description">
Login to use the AI without an API key
</div>
<div className="copilot__signin">
<button onClick={signOut}>Log out</button>
{showSettings && (
<>
<br />
<button onClick={openAccountSettings}>
Manage settings
</button>
</>
)}
<>
<br />
<button onClick={openAccountSettings}>
Manage settings
</button>
</>
)}
<br />
</div>
</div>
Expand All @@ -522,17 +525,15 @@ export function CursorLogin({
Upgrade for unlimited generations
</div>
<div className="copilot__signin">
<button onClick={upgrade}>Upgrade to Pro</button>
<button onClick={upgrade}>Upgrade to Pro</button>
</div>
</div>
</>
)
}
}

return (
currentPanel
)
return currentPanel
}

function CopilotPanel() {
Expand Down