Immediately parse pre-filled links in composer state (#6974)

* Immediately parse pre-filled links in composer state

* Add hack to fix PasteInput height bug

* Parse out ext links separately from post links
This commit is contained in:
Eric Bailey
2024-12-06 16:43:49 -06:00
committed by GitHub
parent 8c68093d24
commit d05217e560
3 changed files with 75 additions and 5 deletions
@@ -257,6 +257,10 @@ export const TextInput = forwardRef(function TextInputImpl(
minHeight: 60,
includeFontPadding: false,
},
{
borderWidth: 1,
borderColor: 'transparent',
},
]}
{...props}>
{textDecorated}
@@ -6,7 +6,7 @@ export type LinkFacetMatch = {
}
export function suggestLinkCardUri(
mayBePaste: boolean,
suggestLinkImmediately: boolean,
nextDetectedUris: Map<string, LinkFacetMatch>,
prevDetectedUris: Map<string, LinkFacetMatch>,
pastSuggestedUris: Set<string>,
@@ -20,8 +20,8 @@ export function suggestLinkCardUri(
// Don't suggest already added or already dismissed link cards.
continue
}
if (mayBePaste) {
// Immediately add the pasted link without waiting to type more.
if (suggestLinkImmediately) {
// Immediately add the pasted or intent-prefilled link without waiting to type more.
suggestedUris.add(uri)
continue
}