From 836570604acc888f4d5f95eb68793a4aca5683a2 Mon Sep 17 00:00:00 2001 From: Daniel Wallace <132221630+git-commit-amen@users.noreply.github.com> Date: Mon, 8 Apr 2024 23:52:10 +1000 Subject: [PATCH] Request URL bar fix and collection name truncation improvement (#7222) * Issue #7221: Pressing enter/return while text is selected in the request URL bar causes the selected text to be deleted - Fixed 'paste' handling code which was causing text replacement logic to run when text had merely been selected but not actually changed Issue #7029: Unable to see full collection names - Added title (hover tooltip) for name label on collection card * add title to workspace dropdown * Update packages/insomnia/src/ui/components/codemirror/one-line-editor.tsx --------- Co-authored-by: Filipe Freire Co-authored-by: Jack Kavanagh --- .../insomnia/src/ui/components/codemirror/one-line-editor.tsx | 4 +++- .../src/ui/components/dropdowns/workspace-dropdown.tsx | 2 +- packages/insomnia/src/ui/routes/project.tsx | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/insomnia/src/ui/components/codemirror/one-line-editor.tsx b/packages/insomnia/src/ui/components/codemirror/one-line-editor.tsx index fa068182b..3f469e3cd 100644 --- a/packages/insomnia/src/ui/components/codemirror/one-line-editor.tsx +++ b/packages/insomnia/src/ui/components/codemirror/one-line-editor.tsx @@ -109,7 +109,9 @@ export const OneLineEditor = forwardRef codeMirror.current.on('beforeChange', (_: CodeMirror.Editor, change: CodeMirror.EditorChangeCancellable) => { const isPaste = change.text && change.text.length > 1; if (isPaste) { - if (change.text[0].startsWith('curl')) { + const startsWithCurl = change.text[0].startsWith('curl'); + const isWhitespace = change.text.join('').trim(); + if (startsWithCurl || !isWhitespace) { change.cancel(); return; } diff --git a/packages/insomnia/src/ui/components/dropdowns/workspace-dropdown.tsx b/packages/insomnia/src/ui/components/dropdowns/workspace-dropdown.tsx index 48ffc8424..857a58363 100644 --- a/packages/insomnia/src/ui/components/dropdowns/workspace-dropdown.tsx +++ b/packages/insomnia/src/ui/components/dropdowns/workspace-dropdown.tsx @@ -205,7 +205,7 @@ export const WorkspaceDropdown: FC = () => { data-testid="workspace-context-dropdown" className="px-3 py-1 h-7 flex flex-1 items-center justify-center gap-2 aria-pressed:bg-[--hl-sm] rounded-sm text-[--color-font] hover:bg-[--hl-xs] focus:ring-inset ring-1 ring-transparent focus:ring-[--hl-md] transition-all text-sm truncate" > - {activeWorkspaceName} + {activeWorkspaceName} diff --git a/packages/insomnia/src/ui/routes/project.tsx b/packages/insomnia/src/ui/routes/project.tsx index dca472f21..1834759b3 100644 --- a/packages/insomnia/src/ui/routes/project.tsx +++ b/packages/insomnia/src/ui/routes/project.tsx @@ -1360,7 +1360,7 @@ const ProjectRoute: FC = () => { /> )} - + {item.name}