mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-12-03 12:49:30 +00:00
84653bb416
* Fetches link previews for all links in message (instead of just the first one) * message url component to display preview for multiple urls * Revert visible behaviour back to only showing one URL preview While fetching all link previews in the text message. * Moved URL preview VM to MessageComposer * Added com.beeper.linkpreviews to messages sent with the markdown compositor * MSC 4452 implemented for the older (markdown) composer * claude told me to use logger instead of console * Previews generated with snapshot instead of vm * moved attachPreviews to a separate file * added attach URL previews to rich text editor * don't let attachUrlPreviews block clearning the composer * fixed linter errors * moved url preview behind labs feature gate * passed linters * moved lab feature checking to where attach preview is used * claude wrote some unit tests for url previewing * fixed linter errors * added feature to labs.md * fixed linter errors * fixed oxfmt error * set previews to none if all previews failed * resolved PR reviews besides the ones that requires a larger code change * moved url preview VM creation to message composer * removed delay when clearing composer url preview on message send * minor changes to stop using globals everywhere * moved debouncing responsibility to urlpreviewVM * minor lint fixes * added comment * remove composer content from the state of urlpreview, moved it to the vm * urlpreviewwrapper depends on the vm only * added comments * edited the comment * updated snapshots * claude fixed tests * enable feature for tests that requires MSC4095 * updated snapshot
122 lines
2.8 KiB
Plaintext
122 lines
2.8 KiB
Plaintext
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
|
|
exports[`UrlPreviewGroupViewModel should deduplicate multiple versions of the same URL 1`] = `
|
|
{
|
|
"overPreviewLimit": false,
|
|
"previews": [
|
|
{
|
|
"author": undefined,
|
|
"description": "This is a description",
|
|
"image": undefined,
|
|
"link": "https://example.org",
|
|
"ogUrl": "https://example.org",
|
|
"showTooltipOnLink": false,
|
|
"siteIcon": undefined,
|
|
"siteName": "Example.org",
|
|
"title": "This is an example!",
|
|
},
|
|
],
|
|
"previewsLimited": true,
|
|
"totalPreviewCount": 1,
|
|
}
|
|
`;
|
|
|
|
exports[`UrlPreviewGroupViewModel should handle being hidden and shown by the user 1`] = `
|
|
{
|
|
"overPreviewLimit": false,
|
|
"previews": [],
|
|
"previewsLimited": true,
|
|
"totalPreviewCount": 1,
|
|
}
|
|
`;
|
|
|
|
exports[`UrlPreviewGroupViewModel should handle being hidden and shown by the user 2`] = `
|
|
{
|
|
"overPreviewLimit": false,
|
|
"previews": [
|
|
{
|
|
"author": undefined,
|
|
"description": "This is a description",
|
|
"image": undefined,
|
|
"link": "https://example.org",
|
|
"ogUrl": "https://example.org",
|
|
"showTooltipOnLink": false,
|
|
"siteIcon": undefined,
|
|
"siteName": "Example.org",
|
|
"title": "This is an example!",
|
|
},
|
|
],
|
|
"previewsLimited": true,
|
|
"totalPreviewCount": 1,
|
|
}
|
|
`;
|
|
|
|
exports[`UrlPreviewGroupViewModel should hide preview when invisible 1`] = `
|
|
{
|
|
"overPreviewLimit": false,
|
|
"previews": [],
|
|
"previewsLimited": true,
|
|
"totalPreviewCount": 1,
|
|
}
|
|
`;
|
|
|
|
exports[`UrlPreviewGroupViewModel should ignore failed previews 1`] = `
|
|
{
|
|
"overPreviewLimit": false,
|
|
"previews": [],
|
|
"previewsLimited": true,
|
|
"totalPreviewCount": 1,
|
|
}
|
|
`;
|
|
|
|
exports[`UrlPreviewGroupViewModel should ignore media when mediaVisible is false 1`] = `
|
|
{
|
|
"overPreviewLimit": false,
|
|
"previews": [
|
|
{
|
|
"author": undefined,
|
|
"description": undefined,
|
|
"image": undefined,
|
|
"link": "https://example.org",
|
|
"ogUrl": "https://example.org",
|
|
"showTooltipOnLink": false,
|
|
"siteIcon": undefined,
|
|
"siteName": "example.org",
|
|
"title": "This is an example!",
|
|
},
|
|
],
|
|
"previewsLimited": true,
|
|
"totalPreviewCount": 1,
|
|
}
|
|
`;
|
|
|
|
exports[`UrlPreviewGroupViewModel should preview a single valid URL 1`] = `
|
|
{
|
|
"overPreviewLimit": false,
|
|
"previews": [
|
|
{
|
|
"author": undefined,
|
|
"description": "This is a description",
|
|
"image": undefined,
|
|
"link": "https://example.org",
|
|
"ogUrl": "https://example.org",
|
|
"showTooltipOnLink": false,
|
|
"siteIcon": undefined,
|
|
"siteName": "Example.org",
|
|
"title": "This is an example!",
|
|
},
|
|
],
|
|
"previewsLimited": true,
|
|
"totalPreviewCount": 1,
|
|
}
|
|
`;
|
|
|
|
exports[`UrlPreviewGroupViewModel should return no previews by default 1`] = `
|
|
{
|
|
"overPreviewLimit": false,
|
|
"previews": [],
|
|
"previewsLimited": true,
|
|
"totalPreviewCount": 0,
|
|
}
|
|
`;
|