Skip to content

Commit

Permalink
Request URL bar fix and collection name truncation improvement (#7222)
Browse files Browse the repository at this point in the history
* 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 <filipe.freire@konghq.com>
Co-authored-by: Jack Kavanagh <jackkav@gmail.com>
  • Loading branch information
3 people authored Apr 8, 2024
1 parent 26a78cf commit 8365706
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ export const OneLineEditor = forwardRef<OneLineEditorHandle, OneLineEditorProps>
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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
>
<span className="truncate">{activeWorkspaceName}</span>
<span className="truncate" title={activeWorkspaceName}>{activeWorkspaceName}</span>
<Icon icon="caret-down" />
</Button>
<Popover className="min-w-max">
Expand Down
2 changes: 1 addition & 1 deletion packages/insomnia/src/ui/routes/project.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1360,7 +1360,7 @@ const ProjectRoute: FC = () => {
/>
)}
</div>
<Heading className="pt-4 text-lg font-bold truncate">
<Heading className="pt-4 text-lg font-bold truncate" title={item.name}>
{item.name}
</Heading>
<div className="flex-1 flex flex-col gap-2 justify-end text-sm text-[--hl]">
Expand Down

0 comments on commit 8365706

Please sign in to comment.