🩹(frontend) small ui improvement

- center initial loader before app load
- add name on input to remove warning
- fix hover on interlinking link
This commit is contained in:
Anthony LC
2025-12-19 17:10:05 +01:00
parent 30bc959340
commit 37527416f2
5 changed files with 34 additions and 26 deletions

View File

@@ -880,14 +880,15 @@ test.describe('Doc Editor', () => {
// Wait for the interlink to be created and rendered // Wait for the interlink to be created and rendered
const editor = await getEditor({ page }); const editor = await getEditor({ page });
const interlinkChild2 = editor.getByRole('button', { const interlinkChild = editor
name: docChild2, .locator('.--docs--interlinking-link-inline-content')
}); .first();
await expect(interlinkChild2).toBeVisible({ timeout: 10000 }); await expect(interlinkChild).toBeVisible({ timeout: 10000 });
await expect(interlinkChild2).toContainText('😀'); await expect(interlinkChild).toContainText('😀');
await expect(interlinkChild2.locator('svg').first()).toBeHidden(); await expect(interlinkChild).toContainText(docChild2);
await interlinkChild2.click(); await expect(interlinkChild.locator('svg').first()).toBeHidden();
await interlinkChild.click();
await verifyDocName(page, docChild2); await verifyDocName(page, docChild2);
@@ -897,11 +898,9 @@ test.describe('Doc Editor', () => {
await input.fill(docChild1); await input.fill(docChild1);
await searchContainer.getByText(docChild1).click(); await searchContainer.getByText(docChild1).click();
const interlinkChild1 = editor.getByRole('button', { await expect(interlinkChild).toContainText(docChild1);
name: docChild1, await expect(interlinkChild).toBeVisible({ timeout: 10000 });
}); await expect(interlinkChild.locator('svg').first()).toBeVisible();
await expect(interlinkChild1).toBeVisible({ timeout: 10000 });
await expect(interlinkChild1.locator('svg').first()).toBeVisible();
await page.keyboard.press('@'); await page.keyboard.press('@');

View File

@@ -527,7 +527,7 @@ test.describe('Doc Export', () => {
await verifyDocName(page, docChild); await verifyDocName(page, docChild);
await page.locator('.bn-block-outer').last().fill('/'); const editor = await openSuggestionMenu({ page });
await page.getByText('Link a doc').first().click(); await page.getByText('Link a doc').first().click();
const input = page.locator( const input = page.locator(
@@ -544,12 +544,11 @@ test.describe('Doc Export', () => {
await searchContainer.getByText(randomDoc).click(); await searchContainer.getByText(randomDoc).click();
// Search the interlinking link in the editor (not in the document tree) // Search the interlinking link in the editor (not in the document tree)
const editor = page.locator('.ProseMirror.bn-editor'); const interlink = editor
const interlink = editor.getByRole('button', { .locator('.--docs--interlinking-link-inline-content')
name: randomDoc, .first();
});
await expect(interlink).toBeVisible(); await expect(interlink).toContainText(randomDoc);
const downloadPromise = page.waitForEvent('download', (download) => { const downloadPromise = page.waitForEvent('download', (download) => {
return download.suggestedFilename().includes(`${docChild}.pdf`); return download.suggestedFilename().includes(`${docChild}.pdf`);
@@ -593,7 +592,7 @@ test.describe('Doc Export', () => {
await verifyDocName(page, docChild); await verifyDocName(page, docChild);
await page.locator('.bn-block-outer').last().fill('/'); const editor = await openSuggestionMenu({ page });
await page.getByText('Link a doc').first().click(); await page.getByText('Link a doc').first().click();
const input = page.locator( const input = page.locator(
@@ -610,12 +609,11 @@ test.describe('Doc Export', () => {
await searchContainer.getByText(randomDoc).click(); await searchContainer.getByText(randomDoc).click();
// Search the interlinking link in the editor (not in the document tree) // Search the interlinking link in the editor (not in the document tree)
const editor = page.locator('.ProseMirror.bn-editor'); const interlink = editor
const interlink = editor.getByRole('button', { .locator('.--docs--interlinking-link-inline-content')
name: randomDoc, .first();
});
await expect(interlink).toBeVisible(); await expect(interlink).toContainText(randomDoc);
await page await page
.getByRole('button', { .getByRole('button', {

View File

@@ -79,10 +79,12 @@ const LinkSelected = ({ url, title }: LinkSelectedProps) => {
return ( return (
<BoxButton <BoxButton
as="span"
className="--docs--interlinking-link-inline-content"
onClick={handleClick} onClick={handleClick}
draggable="false" draggable="false"
$css={css` $css={css`
display: contents; display: inline;
padding: 0.1rem 0.4rem; padding: 0.1rem 0.4rem;
border-radius: 4px; border-radius: 4px;
& svg { & svg {
@@ -91,7 +93,9 @@ const LinkSelected = ({ url, title }: LinkSelectedProps) => {
margin-right: 0.2rem; margin-right: 0.2rem;
} }
&:hover { &:hover {
background-color: ${colorsTokens['gray-100']}; background-color: var(
--c--contextuals--background--semantic--contextual--primary
);
} }
transition: background-color var(--c--globals--transitions--duration) transition: background-color var(--c--globals--transitions--duration)
var(--c--globals--transitions--ease-out); var(--c--globals--transitions--ease-out);

View File

@@ -171,6 +171,7 @@ export const SearchPage = ({
{trigger} {trigger}
<Box <Box
as="input" as="input"
name="doc-search-input"
$padding={{ left: '3px' }} $padding={{ left: '3px' }}
$css={inputStyle} $css={inputStyle}
ref={inputRef} ref={inputRef}

View File

@@ -10,6 +10,12 @@ body {
padding: 0; padding: 0;
} }
/* stylelint-disable-next-line selector-id-pattern */
body > #__next > .c__app > div:has(> .c__loader) {
min-height: 100vh;
width: 100vw;
}
* { * {
box-sizing: border-box; box-sizing: border-box;
} }