mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
fix issues (#136)
* fix: prevent delete button click when card is not swiped open * refactor: improve CreateRepoInput type safety * security: require AUTH_SECRET and use secure random generation * fix: SSH key path validation, async passphrase stripping, and port handling * fix: use correct console methods for logger levels * Add error handling to DB update functions and improve migration logging * Add error handling for session lookup in auth middleware * Add structured git error handling with user-friendly messages - Parse git errors with specific error codes (AUTH_FAILED, REPO_NOT_FOUND, PUSH_REJECTED, MERGE_CONFLICT, etc.) and appropriate HTTP status codes - Return structured error responses with summary and detail from backend - Add GitErrorBanner component for better error display in UI - Add optional onError callback to useGit hook for external error handling * Make IPC server initialization/disposal async and fix SSH host key handler * add try-catch error handling in frontend lib utilities * remove unresolved promise handlers in speech synthesizer callbacks * Extract error types to shared package * Import GitErrorCode from shared package * Refactor API layer to use shared FetchError and fetchWrapper * Update prompt parser and source control components * Extract MCP server list to separate component with improved badge menu UX * merge useSettingsDialogUrl into useSettingsDialog and extract getRepoDisplayName utility * add separate loading state for passkey sign in * refactor hooks: use fetchWrapper, improve error handling, add proper types * replace browser confirm() with DeleteDialog component in settings * fix: add missing variables parameter in React Query onError callbacks * Refactor message parts to use separate Zustand store * Update QuestionPrompt styling for light/dark mode
This commit is contained in:
1 parent
7f7d106c28
commit
5de419ee28
75 files changed
+1990
-1367
No files matched your search
@@ -179,20 +179,20 @@ export function QuestionPrompt({ question, onReply, onReject }: QuestionPromptPr
|
||||
|
||||
return (
|
||||
<div
|
||||
className="w-full bg-gradient-to-br from-blue-500/10 to-blue-600/5 border-2 border-blue-500/30 rounded-xl shadow-lg shadow-blue-500/10 backdrop-blur-sm mb-3 overflow-hidden"
|
||||
className="w-full bg-gradient-to-br from-blue-100 to-blue-200 dark:from-blue-950 dark:to-blue-900 border-2 border-blue-300 dark:border-blue-700 rounded-xl shadow-lg shadow-blue-500/20 mb-3 overflow-hidden"
|
||||
>
|
||||
<div className="flex items-center justify-between px-2 py-1.5 sm:px-3 sm:py-2 border-b border-blue-500/20 bg-blue-500/5">
|
||||
<div className="flex items-center justify-between px-2 py-1.5 sm:px-3 sm:py-2 border-b border-blue-200 dark:border-blue-800 bg-blue-50 dark:bg-blue-900/50">
|
||||
<div className="flex items-center gap-2">
|
||||
{totalSteps > 1 && (
|
||||
<button
|
||||
onClick={goToPrev}
|
||||
disabled={currentIndex === 0}
|
||||
className="p-0.5 sm:p-1 rounded hover:bg-blue-500/20 disabled:opacity-30 disabled:cursor-not-allowed transition-colors"
|
||||
className="p-0.5 sm:p-1 rounded hover:bg-blue-200 dark:hover:bg-blue-800 disabled:opacity-30 disabled:cursor-not-allowed transition-colors"
|
||||
>
|
||||
<ChevronLeft className="w-3.5 h-3.5 sm:w-4 sm:h-4 text-blue-600 dark:text-blue-400" />
|
||||
</button>
|
||||
)}
|
||||
<span className="text-xs sm:text-sm font-semibold text-blue-400">
|
||||
<span className="text-xs sm:text-sm font-semibold text-blue-600 dark:text-white">
|
||||
{isConfirmStep ? 'Review' : (
|
||||
totalSteps > 1
|
||||
? `Question ${currentIndex + 1}/${questions.length}`
|
||||
@@ -203,7 +203,7 @@ export function QuestionPrompt({ question, onReply, onReject }: QuestionPromptPr
|
||||
<button
|
||||
onClick={goToNext}
|
||||
disabled={currentIndex === totalSteps - 1}
|
||||
className="p-0.5 sm:p-1 rounded hover:bg-blue-500/20 disabled:opacity-30 disabled:cursor-not-allowed transition-colors"
|
||||
className="p-0.5 sm:p-1 rounded hover:bg-blue-200 dark:hover:bg-blue-800 disabled:opacity-30 disabled:cursor-not-allowed transition-colors"
|
||||
>
|
||||
<ChevronRight className="w-3.5 h-3.5 sm:w-4 sm:h-4 text-blue-600 dark:text-blue-400" />
|
||||
</button>
|
||||
@@ -218,7 +218,7 @@ export function QuestionPrompt({ question, onReply, onReject }: QuestionPromptPr
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div className="p-2 sm:p-3 max-h-[50vh] sm:max-h-[70vh] overflow-y-auto overflow-x-hidden">
|
||||
<div className="p-2 sm:p-3 max-h-[50vh] sm:max-h-[70vh] overflow-y-auto overflow-x-hidden bg-background/60 dark:bg-black/30">
|
||||
{isConfirmStep ? (
|
||||
<ConfirmStep
|
||||
questions={questions}
|
||||
@@ -243,7 +243,7 @@ export function QuestionPrompt({ question, onReply, onReject }: QuestionPromptPr
|
||||
</div>
|
||||
|
||||
{totalSteps > 1 && (
|
||||
<div className="flex justify-center gap-1 sm:gap-1.5 py-1.5 sm:py-2 border-t border-blue-500/10">
|
||||
<div className="flex justify-center gap-1 sm:gap-1.5 py-1.5 sm:py-2 border-t border-blue-200 dark:border-blue-800">
|
||||
{Array.from({ length: totalSteps }).map((_, i) => (
|
||||
<button
|
||||
key={i}
|
||||
@@ -264,7 +264,7 @@ export function QuestionPrompt({ question, onReply, onReject }: QuestionPromptPr
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="flex gap-1.5 sm:gap-2 px-2 pb-2 sm:px-3 sm:pb-3">
|
||||
<div className="flex gap-1.5 sm:gap-2 px-2 py-2 sm:px-3 sm:py-3">
|
||||
<Button
|
||||
size="sm"
|
||||
onClick={handleReject}
|
||||
@@ -362,10 +362,10 @@ function QuestionStep({
|
||||
key={i}
|
||||
onClick={() => onSelectOption(option.label)}
|
||||
className={cn(
|
||||
"w-full text-left p-2 sm:p-3 rounded-lg border-2 transition-all duration-200 active:scale-[0.98]",
|
||||
"w-full text-left p-2 sm:p-3 rounded-lg transition-all duration-200 active:scale-[0.98]",
|
||||
isSelected
|
||||
? "border-blue-500 bg-blue-500/10"
|
||||
: "border-border hover:border-blue-500/50 hover:bg-blue-500/5"
|
||||
? "bg-blue-200 dark:bg-blue-700/50"
|
||||
: "bg-white/40 dark:bg-white/5 hover:bg-white/60 dark:hover:bg-white/10"
|
||||
)}
|
||||
>
|
||||
<div className="flex items-start justify-between gap-1.5 sm:gap-2">
|
||||
@@ -380,7 +380,7 @@ function QuestionStep({
|
||||
</div>
|
||||
<span className={cn(
|
||||
"text-xs sm:text-sm font-semibold",
|
||||
isSelected ? "text-blue-400" : "text-foreground"
|
||||
isSelected ? "text-blue-600 dark:text-blue-300" : "text-foreground"
|
||||
)}>
|
||||
{option.label}
|
||||
</span>
|
||||
@@ -404,10 +404,10 @@ function QuestionStep({
|
||||
}
|
||||
}}
|
||||
className={cn(
|
||||
"w-full text-left p-2 sm:p-3 rounded-lg border-2 transition-all duration-200",
|
||||
"w-full text-left p-2 sm:p-3 rounded-lg transition-all duration-200",
|
||||
expandedOther || isCustomSelected
|
||||
? "border-blue-500 bg-blue-500/10"
|
||||
: "border-border hover:border-blue-500/50 hover:bg-blue-500/5"
|
||||
? "bg-blue-200 dark:bg-blue-700/50"
|
||||
: "bg-white/40 dark:bg-white/5 hover:bg-white/60 dark:hover:bg-white/10"
|
||||
)}
|
||||
>
|
||||
<div className="flex items-center gap-1.5 sm:gap-2">
|
||||
@@ -421,7 +421,7 @@ function QuestionStep({
|
||||
</div>
|
||||
<span className={cn(
|
||||
"text-xs sm:text-sm font-semibold",
|
||||
expandedOther || isCustomSelected ? "text-blue-400" : "text-foreground"
|
||||
expandedOther || isCustomSelected ? "text-blue-600 dark:text-blue-300" : "text-foreground"
|
||||
)}>
|
||||
Other...
|
||||
</span>
|
||||
@@ -479,18 +479,18 @@ function ConfirmStep({ questions, answers, onEditQuestion }: ConfirmStepProps) {
|
||||
key={i}
|
||||
onClick={() => onEditQuestion(i)}
|
||||
className={cn(
|
||||
"w-full text-left p-2 sm:p-3 rounded-lg border transition-colors",
|
||||
"w-full text-left p-2 sm:p-3 rounded-lg transition-colors",
|
||||
hasAnswer
|
||||
? "border-green-500/40 bg-green-500/10 hover:bg-green-500/15"
|
||||
: "border-red-500/40 bg-red-500/10 hover:bg-red-500/15"
|
||||
? "bg-green-50 dark:bg-green-900/30 hover:bg-green-100 dark:hover:bg-green-900/50"
|
||||
: "bg-red-50 dark:bg-red-900/30 hover:bg-red-100 dark:hover:bg-red-900/50"
|
||||
)}
|
||||
>
|
||||
<div className="flex items-start justify-between gap-1.5 sm:gap-2">
|
||||
<div className="min-w-0 flex-1">
|
||||
<p className="text-[10px] sm:text-xs text-foreground/60 truncate">{q.header}</p>
|
||||
<p className="text-[10px] sm:text-xs text-muted-foreground truncate">{q.header}</p>
|
||||
<p className={cn(
|
||||
"text-xs sm:text-sm font-semibold mt-0.5",
|
||||
hasAnswer ? "text-green-400" : "text-red-400"
|
||||
hasAnswer ? "text-green-700 dark:text-green-400" : "text-red-700 dark:text-red-400"
|
||||
)}>
|
||||
{hasAnswer ? answer.join(', ') : '(not answered)'}
|
||||
</p>
|
||||
|
||||
@@ -45,7 +45,7 @@ export const SessionCard = ({
|
||||
<div className="relative" onClick={close}>
|
||||
<div
|
||||
className={`absolute top-0.5 right-0 bottom-0.5 w-20 bg-red-600 flex items-center justify-center rounded-r-lg transition-opacity ${
|
||||
!isSwipingBack && (isOpen || swipeOffset > 40) ? "opacity-100" : "opacity-0"
|
||||
!isSwipingBack && (isOpen || swipeOffset > 40) ? "opacity-100" : "opacity-0 pointer-events-none"
|
||||
}`}
|
||||
>
|
||||
<button
|
||||
|
||||
Reference in new issue
Block a user