fix: multiple UI and server bug fixes (#11593)
This commit is contained in:
1 parent
438465d6b7
commit
24b711b7f9
6 files changed
+36
-23
No files matched your search
@@ -410,6 +410,7 @@ public final class T3TerminalView: ExpoView, UITextFieldDelegate {
|
||||
return false
|
||||
}
|
||||
|
||||
emitInput("\u{7F}")
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
@@ -366,25 +366,6 @@ export const make = Effect.gen(function* () {
|
||||
.execute(request)
|
||||
.pipe(Effect.provideService(FetchHttpClient.RequestInit, { redirect: "manual" }));
|
||||
const status = response.status;
|
||||
if (status < 200 || status >= 300)
|
||||
return yield* new ForgejoCliError({
|
||||
command: "fj",
|
||||
cwd: input.cwd,
|
||||
httpStatus: status,
|
||||
...(status === 401
|
||||
? { reason: "authentication" as const }
|
||||
: status === 403
|
||||
? { reason: "forbidden" as const }
|
||||
: status === 404
|
||||
? { reason: "not-found" as const }
|
||||
: status === 429
|
||||
? { reason: "rate-limit" as const }
|
||||
: {}),
|
||||
detail:
|
||||
status === 404
|
||||
? "Forgejo repository or pull request was not found."
|
||||
: `Forgejo API request failed (HTTP ${status}). Check this server's fj credentials and permissions.`,
|
||||
});
|
||||
const body =
|
||||
status === 204 || status === 205
|
||||
? { text: "", truncated: false, invalidUtf8: false }
|
||||
@@ -399,6 +380,29 @@ export const make = Effect.gen(function* () {
|
||||
reason: "invalid-response",
|
||||
detail: "Forgejo returned an oversized or invalid response.",
|
||||
});
|
||||
if (status < 200 || status >= 300) {
|
||||
const detail =
|
||||
status === 404
|
||||
? "Forgejo repository or pull request was not found."
|
||||
: body.text
|
||||
? `Forgejo API request failed (HTTP ${status}): ${body.text}`
|
||||
: `Forgejo API request failed (HTTP ${status}). Check this server's fj credentials and permissions.`;
|
||||
return yield* new ForgejoCliError({
|
||||
command: "fj",
|
||||
cwd: input.cwd,
|
||||
httpStatus: status,
|
||||
...(status === 401
|
||||
? { reason: "authentication" as const }
|
||||
: status === 403
|
||||
? { reason: "forbidden" as const }
|
||||
: status === 404
|
||||
? { reason: "not-found" as const }
|
||||
: status === 429
|
||||
? { reason: "rate-limit" as const }
|
||||
: {}),
|
||||
detail,
|
||||
});
|
||||
}
|
||||
return {
|
||||
exitCode: ChildProcessSpawner.ExitCode(0),
|
||||
stdout: body.text,
|
||||
|
||||
@@ -203,7 +203,7 @@ export const ModelPickerSidebar = memo(function ModelPickerSidebar(props: {
|
||||
displayName={entry.displayName}
|
||||
accentColor={entry.accentColor}
|
||||
showBadge={showInstanceBadge}
|
||||
className="size-6"
|
||||
className="size-6 z-30"
|
||||
iconClassName="size-5"
|
||||
indicatorBackground={
|
||||
isHovered && !isDisabled
|
||||
|
||||
@@ -29,7 +29,7 @@ export const ProviderInstanceIcon = memo(function ProviderInstanceIcon(props: {
|
||||
return (
|
||||
<span
|
||||
className={cn(
|
||||
"relative isolate inline-flex shrink-0 items-center justify-center overflow-visible",
|
||||
"relative isolate z-30 inline-flex shrink-0 items-center justify-center overflow-visible",
|
||||
props.className,
|
||||
)}
|
||||
style={accentStyle}
|
||||
|
||||
@@ -25,6 +25,7 @@ import {
|
||||
type ComposerControlSize,
|
||||
} from "./ComposerControl";
|
||||
import { useComposerMenuProps } from "./composerEventScope";
|
||||
import { shortcutLabelForCommand } from "../../keybindings";
|
||||
|
||||
export const ProviderModelPicker = memo(function ProviderModelPicker(props: {
|
||||
/**
|
||||
@@ -154,6 +155,13 @@ export const ProviderModelPicker = memo(function ProviderModelPicker(props: {
|
||||
setIsMenuOpen(false);
|
||||
};
|
||||
|
||||
const shortcutLabel = props.keybindings
|
||||
? shortcutLabelForCommand(props.keybindings, "modelPicker.toggle")
|
||||
: null;
|
||||
const triggerTooltipContent = shortcutLabel
|
||||
? `${props.triggerLabel ?? triggerLabel} · ${shortcutLabel}`
|
||||
: (props.triggerLabel ?? triggerLabel);
|
||||
|
||||
return (
|
||||
<Popover
|
||||
open={isMenuOpen}
|
||||
@@ -210,7 +218,7 @@ export const ProviderModelPicker = memo(function ProviderModelPicker(props: {
|
||||
>
|
||||
{props.triggerLabel ?? triggerTitle}
|
||||
</TooltipTrigger>
|
||||
<TooltipPopup side="top">{props.triggerLabel ?? triggerLabel}</TooltipPopup>
|
||||
<TooltipPopup side="top">{triggerTooltipContent}</TooltipPopup>
|
||||
</Tooltip>
|
||||
{selectedModel?.isUnavailable && props.triggerLabel === undefined ? (
|
||||
<Badge variant="outline" size="sm">
|
||||
|
||||
@@ -5,7 +5,7 @@ const DIALOG_BACKDROP_CLASS = `dialog-backdrop ${DIALOG_BACKDROP_BASE_CLASS}`;
|
||||
const DIALOG_MEDIA_BACKDROP_CLASS = `${DIALOG_BACKDROP_BASE_CLASS} bg-black/75 backdrop-blur-none`;
|
||||
|
||||
const DIALOG_POPUP_BASE_CLASS =
|
||||
"-translate-y-[calc(1.25rem*var(--nested-dialogs))] relative flex min-h-0 w-full min-w-0 scale-[calc(1-0.1*var(--nested-dialogs))] flex-col opacity-[calc(1-0.1*var(--nested-dialogs))] outline-none transition-[scale,opacity,translate] duration-200 ease-in-out will-change-transform data-nested:data-ending-style:translate-y-8 data-nested:data-starting-style:translate-y-8 data-nested-dialog-open:origin-top data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0";
|
||||
"-translate-y-[calc(1.25rem*var(--nested-dialogs))] relative flex min-h-0 w-full min-w-0 scale-[calc(1-0.1*var(--nested-dialogs))] flex-col opacity-[calc(1-0.1*var(--nested-dialogs))] outline-none transition-[scale,opacity,translate] duration-200 ease-in-out will-change-transform data-nested:data-ending-style:translate-y-8 data-nested:data-starting-style:translate-y-8 data-nested-dialog-open:origin-top data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 [-webkit-app-region:no-drag]";
|
||||
|
||||
const DIALOG_POPUP_CLASS = `dialog-glass ${DIALOG_POPUP_BASE_CLASS} rounded-2xl border`;
|
||||
const DIALOG_MEDIA_POPUP_CLASS = `${DIALOG_POPUP_BASE_CLASS} max-h-[92vh] w-auto max-w-[92vw] overflow-visible rounded-none border border-transparent bg-transparent p-0 shadow-none`;
|
||||
|
||||
Reference in new issue
Block a user