feat(FN-4414): complete Step 5 — add changeset and finalize regression
Fusion-Task-Id: FN-4414 Fusion-Task-Lineage: 086c95f7-a84d-47b9-8d61-b701b5cc8984
This commit is contained in:
5
.changeset/fn-4414-mobile-file-browser-dropdown.md
Normal file
5
.changeset/fn-4414-mobile-file-browser-dropdown.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@runfusion/fusion": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix mobile File Browser workspace selector dropdown clipping by removing header overflow clipping in the mobile modal header layout, so the menu can render fully while title/path truncation remains intact.
|
||||||
@@ -1,11 +1,12 @@
|
|||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import { loadAllAppCss } from "../../test/cssFixture";
|
import { loadAllAppCss } from "../../test/cssFixture";
|
||||||
|
|
||||||
function extractMediaBlock(css: string, query: string): string {
|
function extractMediaBlocks(css: string, query: string): string[] {
|
||||||
const start = css.indexOf(`@media ${query}`);
|
const blocks: string[] = [];
|
||||||
if (start < 0) {
|
let cursor = 0;
|
||||||
throw new Error(`Missing media query: ${query}`);
|
while (cursor < css.length) {
|
||||||
}
|
const start = css.indexOf(`@media ${query}`, cursor);
|
||||||
|
if (start < 0) break;
|
||||||
const open = css.indexOf("{", start);
|
const open = css.indexOf("{", start);
|
||||||
let depth = 1;
|
let depth = 1;
|
||||||
let i = open + 1;
|
let i = open + 1;
|
||||||
@@ -14,17 +15,22 @@ function extractMediaBlock(css: string, query: string): string {
|
|||||||
else if (css[i] === "}") depth -= 1;
|
else if (css[i] === "}") depth -= 1;
|
||||||
i += 1;
|
i += 1;
|
||||||
}
|
}
|
||||||
return css.slice(open + 1, i - 1);
|
blocks.push(css.slice(open + 1, i - 1));
|
||||||
|
cursor = i;
|
||||||
|
}
|
||||||
|
return blocks;
|
||||||
}
|
}
|
||||||
|
|
||||||
describe("FileBrowser mobile dropdown regression", () => {
|
describe("FileBrowser mobile dropdown regression", () => {
|
||||||
it("keeps mobile file-browser header overflow unclipped", () => {
|
it("keeps mobile file-browser header overflow unclipped", () => {
|
||||||
const css = loadAllAppCss();
|
const css = loadAllAppCss();
|
||||||
const mobileBlock = extractMediaBlock(css, "(max-width: 768px)");
|
const mobileBlocks = extractMediaBlocks(css, "(max-width: 768px)");
|
||||||
const headerRuleMatch = mobileBlock.match(/\.file-browser-modal-header\s*\{[^}]*\}/);
|
const headerRule = mobileBlocks
|
||||||
|
.map((block) => block.match(/\.file-browser-modal-header\s*\{[^}]*\}/)?.[0])
|
||||||
|
.find(Boolean);
|
||||||
|
|
||||||
expect(headerRuleMatch?.[0]).toBeTruthy();
|
expect(headerRule).toBeTruthy();
|
||||||
expect(headerRuleMatch?.[0]).not.toMatch(/overflow\s*:\s*hidden/);
|
expect(headerRule).not.toMatch(/overflow\s*:\s*hidden/);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("keeps workspace selector menu positioned above content", () => {
|
it("keeps workspace selector menu positioned above content", () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user