fix(FN-1331): prevent horizontal scroll in task modal logs panel on mobile

- Add overflow-x: auto CSS to task modal logs panel for mobile
- Add unit test for detail body mobile overflow behavior
This commit is contained in:
gsxdsm
2026-04-09 15:02:18 -07:00
parent 0b2d4e5d49
commit ebf7e6ec74
2 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
import { describe, it, expect } from "vitest";
import { readFileSync } from "fs";
import { resolve } from "path";
const css = readFileSync(resolve(__dirname, "../styles.css"), "utf-8");
describe("detail-body mobile overflow (FN-1331)", () => {
it("adds overflow-x: hidden to .detail-body in the main mobile media query", () => {
// Find the main mobile responsive overrides section
const sectionStart = css.indexOf("/* === Mobile Responsive Overrides ===");
const sectionEnd = css.indexOf("/* === Tablet Responsive Tier", sectionStart);
expect(sectionStart).toBeGreaterThan(-1);
expect(sectionEnd).toBeGreaterThan(sectionStart);
const mobileSection = css.slice(sectionStart, sectionEnd);
// Extract .detail-body block within the mobile section
const detailBodyMatch = mobileSection.match(/\.detail-body\s*\{[^}]*\}/s);
expect(detailBodyMatch).toBeTruthy();
expect(detailBodyMatch![0]).toContain("overflow-x: hidden");
});
it("preserves the padding: 14px in the mobile .detail-body rule", () => {
const sectionStart = css.indexOf("/* === Mobile Responsive Overrides ===");
const sectionEnd = css.indexOf("/* === Tablet Responsive Tier", sectionStart);
const mobileSection = css.slice(sectionStart, sectionEnd);
const detailBodyMatch = mobileSection.match(/\.detail-body\s*\{[^}]*\}/s);
expect(detailBodyMatch).toBeTruthy();
expect(detailBodyMatch![0]).toContain("padding: 14px");
});
});

View File

@@ -6106,6 +6106,7 @@ body {
.detail-body {
padding: 14px;
overflow-x: hidden;
}
.detail-title {