mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-11-28 19:22:39 +01:00
Yaak Proxy: HTTPS decryption UI, and Info and Body in the card's tabs
The strip, quiet encrypted rows, warning rows for refused handshakes, the encrypted card with named actions, trust at the first Decrypt, the toast with Undo and Reconnect, the pill's Decrypt everything switch, Settings' Decryption section, the Encrypted sidebar row, and two-step setup. Both body tabs read Body with a type badge; Info leads the request half with the timeline folded in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5148b0f0ba
commit
b0425069f4
43 files changed
+3019
-586
No files matched your search
@@ -2,7 +2,8 @@ import type { Color } from "@yaakapp-internal/plugins";
|
||||
import classNames from "classnames";
|
||||
|
||||
interface Props {
|
||||
count: number | true;
|
||||
/** A number, a dot for `true`, or a short word such as a body's type */
|
||||
count: number | true | string;
|
||||
count2?: number | true;
|
||||
className?: string;
|
||||
color?: Color;
|
||||
|
||||
@@ -98,6 +98,8 @@ export interface DropdownProps {
|
||||
fullWidth?: boolean;
|
||||
hotKeyAction?: HotkeyAction;
|
||||
onOpen?: () => void;
|
||||
/** The menu closed, however it was closed */
|
||||
onClose?: () => void;
|
||||
}
|
||||
|
||||
export interface DropdownRef {
|
||||
@@ -117,7 +119,7 @@ const openAtom = atom<string | null>(null);
|
||||
const openStore = createStore();
|
||||
|
||||
export const Dropdown = forwardRef<DropdownRef, DropdownProps>(function Dropdown(
|
||||
{ children, items, hotKeyAction, fullWidth, onOpen }: DropdownProps,
|
||||
{ children, items, hotKeyAction, fullWidth, onOpen, onClose }: DropdownProps,
|
||||
ref,
|
||||
) {
|
||||
const id = useRef(generateId());
|
||||
@@ -129,9 +131,10 @@ export const Dropdown = forwardRef<DropdownRef, DropdownProps>(function Dropdown
|
||||
const newIsOpen = globalOpenId === id.current;
|
||||
if (newIsOpen !== isOpen) {
|
||||
setIsOpen(newIsOpen);
|
||||
if (!newIsOpen) onClose?.();
|
||||
}
|
||||
});
|
||||
}, [isOpen]);
|
||||
}, [isOpen, onClose]);
|
||||
|
||||
// const [isOpen, _setIsOpen] = useState<boolean>(false);
|
||||
const [defaultSelectedIndex, setDefaultSelectedIndex] = useState<number | null>(null);
|
||||
|
||||
@@ -106,6 +106,8 @@ export interface HttpRequestPaneViewProps {
|
||||
|
||||
/** Tabs only the app has, after the shared ones */
|
||||
extraTabs?: ExtraPaneTab[];
|
||||
/** Tabs only the app has, before the shared ones, like the proxy's Info */
|
||||
leadingTabs?: ExtraPaneTab[];
|
||||
|
||||
/** Replaces the URL bar, as the proxy's card shows a captured request's method and URL */
|
||||
urlLine?: ReactNode;
|
||||
@@ -165,6 +167,7 @@ export function HttpRequestPaneView({
|
||||
authTabs,
|
||||
authContent,
|
||||
extraTabs,
|
||||
leadingTabs,
|
||||
urlLine,
|
||||
defaultTab,
|
||||
activeTab,
|
||||
@@ -187,6 +190,7 @@ export function HttpRequestPaneView({
|
||||
const headerCount = request.headers.filter((h) => h.name && h.enabled !== false).length;
|
||||
const tabs = useMemo<TabItem[]>(
|
||||
() => [
|
||||
...(leadingTabs?.map((t) => t.tab) ?? []),
|
||||
bodyTab ?? {
|
||||
value: REQUEST_TAB_BODY,
|
||||
label: bodyTypeLabel(request.bodyType, request.contentType),
|
||||
@@ -219,6 +223,7 @@ export function HttpRequestPaneView({
|
||||
authTabs,
|
||||
bodyTab,
|
||||
extraTabs,
|
||||
leadingTabs,
|
||||
headerCount,
|
||||
headersTabs,
|
||||
numParams,
|
||||
@@ -319,7 +324,7 @@ export function HttpRequestPaneView({
|
||||
<TabContent value={REQUEST_TAB_BODY} ErrorBoundary={ErrorBoundary}>
|
||||
{renderBody ? renderBody(sharedBody) : sharedBody}
|
||||
</TabContent>
|
||||
{extraTabs?.map(({ tab, content }) => (
|
||||
{[...(leadingTabs ?? []), ...(extraTabs ?? [])].map(({ tab, content }) => (
|
||||
<TabContent key={tab.value} value={tab.value} ErrorBoundary={ErrorBoundary}>
|
||||
{content}
|
||||
</TabContent>
|
||||
|
||||
@@ -66,6 +66,8 @@ export interface HttpResponsePaneViewProps {
|
||||
cookieCounts?: { sent: number; received: number };
|
||||
/** Tabs only the app has, after the shared ones */
|
||||
extraTabs?: ExtraPaneTab[];
|
||||
/** The body tab as the app names it, where it has no menu of its own */
|
||||
bodyTab?: TabItem;
|
||||
textViewer?: ResponseTextViewerExtras;
|
||||
/** Viewers only this app has for a response body, like the client's event stream viewer */
|
||||
renderBodyViewer?: EditorHost["renderBodyViewer"];
|
||||
@@ -111,6 +113,7 @@ export function HttpResponsePaneView({
|
||||
onCancel,
|
||||
cookieCounts: cookieCountsOverride,
|
||||
extraTabs,
|
||||
bodyTab,
|
||||
textViewer,
|
||||
renderBodyViewer,
|
||||
infoRows,
|
||||
@@ -166,7 +169,7 @@ export function HttpResponsePaneView({
|
||||
const headerCount = response?.headers.length ?? 0;
|
||||
return [
|
||||
onViewModeChange == null && itemsAfter.length === 0
|
||||
? { value: RESPONSE_TAB_BODY, label: "Response" }
|
||||
? (bodyTab ?? { value: RESPONSE_TAB_BODY, label: "Response" })
|
||||
: {
|
||||
value: RESPONSE_TAB_BODY,
|
||||
options: {
|
||||
@@ -212,6 +215,7 @@ export function HttpResponsePaneView({
|
||||
...(extraTabs?.map((t) => t.tab) ?? []),
|
||||
];
|
||||
}, [
|
||||
bodyTab,
|
||||
cookieCounts,
|
||||
extraTabs,
|
||||
mimeType,
|
||||
|
||||
Reference in new issue
Block a user