Changesets · Branches · Tags · Compare
| Changeset | 7bdcbb7e117f5f2d612a93ec2aab269914f6dcf3be356db15172dba207aa95dc |
|---|---|
| Author | Dallin Romney <dallinromney@gmail.com> · 2025-06-11 11:35 -07:00 |
| Committer | Dallin Romney <dallinromney@gmail.com> · 2025-06-11 11:35 -07:00 |
| Parents | 151f510e1dc4 |
1 file changed
modified gui/src/components/mainInput/belowMainInput/ContextItemsPeek.tsx +16 −10
| @@ -33,27 +33,21 @@ | ||
| 33 | 33 | function openContextItem() { |
| 34 | 34 | const { uri, name, content } = contextItem; |
| 35 | 35 | |
| 36 | - if (isUrl) { | |
| 37 | - if (uri?.value) { | |
| 38 | - ideMessenger.post("openUrl", uri.value); | |
| 39 | - } else { | |
| 40 | - console.error("Couldn't open url", uri); | |
| 41 | - } | |
| 42 | - } else if (uri) { | |
| 36 | + if (uri && uri?.type === "file") { | |
| 43 | 37 | const isRangeInFile = name.includes(" (") && name.endsWith(")"); |
| 44 | 38 | |
| 45 | 39 | if (isRangeInFile) { |
| 46 | 40 | const rif = ctxItemToRifWithContents(contextItem, true); |
| 47 | - ideMessenger.ide.showLines( | |
| 41 | + void ideMessenger.ide.showLines( | |
| 48 | 42 | rif.filepath, |
| 49 | 43 | rif.range.start.line, |
| 50 | 44 | rif.range.end.line, |
| 51 | 45 | ); |
| 52 | 46 | } else { |
| 53 | - ideMessenger.ide.openFile(uri.value); | |
| 47 | + void ideMessenger.ide.openFile(uri.value); | |
| 54 | 48 | } |
| 55 | 49 | } else { |
| 56 | - ideMessenger.ide.showVirtualFile(name, content); | |
| 50 | + void ideMessenger.ide.showVirtualFile(name, content); | |
| 57 | 51 | } |
| 58 | 52 | } |
| 59 | 53 | |
| @@ -136,6 +130,18 @@ | ||
| 136 | 130 | </div> |
| 137 | 131 | <div |
| 138 | 132 | className={`min-w-0 flex-1 overflow-hidden truncate whitespace-nowrap text-xs text-gray-400 ${isUrl ? "hover:underline" : ""}`} |
| 133 | + onClick={ | |
| 134 | + isUrl | |
| 135 | + ? (e) => { | |
| 136 | + if (contextItem.uri?.value) { | |
| 137 | + e.stopPropagation(); | |
| 138 | + ideMessenger.post("openUrl", contextItem.uri.value); | |
| 139 | + } else { | |
| 140 | + console.error("Couldn't open url", contextItem.uri); | |
| 141 | + } | |
| 142 | + } | |
| 143 | + : undefined | |
| 144 | + } | |
| 139 | 145 | > |
| 140 | 146 | {contextItem.uri?.type === "file" |
| 141 | 147 | ? getUriPathBasename(contextItem.description) |