feat(FN-3965): add mobile footer reservation and touch target fixes
Applies FN-3965 mobile UI fixes: adds bottom safe-area reservation for the mobile nav bar and enforces minimum 36px touch targets on interactive task card elements, with tests covering the responsive layout breakpoints. Fusion-Task-Id: FN-3965
This commit is contained in:
@@ -1623,7 +1623,7 @@ function AppInner() {
|
||||
/>
|
||||
)}
|
||||
<div
|
||||
className={`project-content${viewMode === "project" && currentProject ? " project-content--with-footer" : ""}${isMobile && !mobileKeyboardOpen ? " project-content--with-mobile-nav" : ""}`}
|
||||
className={`project-content${viewMode === "project" && currentProject && (!isMobile || !mobileKeyboardOpen) ? " project-content--with-footer" : ""}${isMobile && !mobileKeyboardOpen ? " project-content--with-mobile-nav" : ""}`}
|
||||
>
|
||||
{renderMainContent()}
|
||||
</div>
|
||||
|
||||
@@ -1087,11 +1087,11 @@
|
||||
/* Card edit button: always visible on mobile (no hover) */
|
||||
.card-edit-btn {
|
||||
opacity: 1;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
margin-right: -8px;
|
||||
margin-top: -8px;
|
||||
margin-bottom: -8px;
|
||||
width: calc(var(--space-xl) + var(--space-md));
|
||||
height: calc(var(--space-xl) + var(--space-md));
|
||||
margin-right: calc(-1 * var(--space-sm));
|
||||
margin-top: calc(-1 * var(--space-sm));
|
||||
margin-bottom: calc(-1 * var(--space-sm));
|
||||
border-radius: var(--radius-md);
|
||||
}
|
||||
|
||||
@@ -1103,11 +1103,11 @@
|
||||
/* Card delete button: always visible on mobile (no hover) */
|
||||
.card-delete-btn {
|
||||
opacity: 1;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
margin-right: -8px;
|
||||
margin-top: -8px;
|
||||
margin-bottom: -8px;
|
||||
width: calc(var(--space-xl) + var(--space-md));
|
||||
height: calc(var(--space-xl) + var(--space-md));
|
||||
margin-right: calc(-1 * var(--space-sm));
|
||||
margin-top: calc(-1 * var(--space-sm));
|
||||
margin-bottom: calc(-1 * var(--space-sm));
|
||||
border-radius: var(--radius-md);
|
||||
}
|
||||
|
||||
|
||||
@@ -286,12 +286,30 @@ describe("TaskCard mobile", () => {
|
||||
expectRuleToContain(css, ".card-session-files span", "white-space: nowrap;");
|
||||
});
|
||||
|
||||
it("sets .card-edit-btn width and height to 32px in the mobile media block", () => {
|
||||
it("uses tokenized 36px touch targets for TaskCard action buttons in the mobile media block", () => {
|
||||
const css = loadAllAppCss();
|
||||
const mobileSection = getMainMobileSection(css);
|
||||
|
||||
expectRuleToContain(mobileSection, ".card-edit-btn", "width: 32px;");
|
||||
expectRuleToContain(mobileSection, ".card-edit-btn", "height: 32px;");
|
||||
expectRuleToContain(
|
||||
mobileSection,
|
||||
".card-edit-btn",
|
||||
"width: calc(var(--space-xl) + var(--space-md));",
|
||||
);
|
||||
expectRuleToContain(
|
||||
mobileSection,
|
||||
".card-edit-btn",
|
||||
"height: calc(var(--space-xl) + var(--space-md));",
|
||||
);
|
||||
expectRuleToContain(
|
||||
mobileSection,
|
||||
".card-delete-btn",
|
||||
"width: calc(var(--space-xl) + var(--space-md));",
|
||||
);
|
||||
expectRuleToContain(
|
||||
mobileSection,
|
||||
".card-delete-btn",
|
||||
"height: calc(var(--space-xl) + var(--space-md));",
|
||||
);
|
||||
});
|
||||
|
||||
it("opens task detail on quick tap", async () => {
|
||||
|
||||
@@ -33,6 +33,15 @@ export function createDraftStore({ rootDir }: { rootDir: string }) {
|
||||
|
||||
async function ensureDir() { await mkdir(draftsDir, { recursive: true }); }
|
||||
|
||||
function nextUpdatedAt(previous?: string): string {
|
||||
const now = Date.now();
|
||||
const previousTime = previous ? Date.parse(previous) : Number.NaN;
|
||||
if (Number.isFinite(previousTime) && now <= previousTime) {
|
||||
return new Date(previousTime + 1).toISOString();
|
||||
}
|
||||
return new Date(now).toISOString();
|
||||
}
|
||||
|
||||
async function writeAtomic(path: string, draft: ServiceDraft): Promise<void> {
|
||||
const tempPath = `${path}.tmp-${randomUUID()}`;
|
||||
await writeFile(tempPath, JSON.stringify(draft, null, 2), "utf8");
|
||||
@@ -42,7 +51,7 @@ export function createDraftStore({ rootDir }: { rootDir: string }) {
|
||||
return {
|
||||
async create(input: ServiceDraft) {
|
||||
await ensureDir();
|
||||
const now = new Date().toISOString();
|
||||
const now = nextUpdatedAt();
|
||||
const draft: ServiceDraft = { ...input, id: input.id || randomUUID(), createdAt: input.createdAt || now, updatedAt: now };
|
||||
await writeAtomic(join(draftsDir, `${draft.id}.json`), draft);
|
||||
return draft;
|
||||
@@ -64,7 +73,7 @@ export function createDraftStore({ rootDir }: { rootDir: string }) {
|
||||
...mergeDraft(current, patch),
|
||||
id: current.id,
|
||||
createdAt: current.createdAt,
|
||||
updatedAt: new Date().toISOString(),
|
||||
updatedAt: nextUpdatedAt(current.updatedAt),
|
||||
};
|
||||
await writeAtomic(join(draftsDir, `${id}.json`), updated);
|
||||
return updated;
|
||||
|
||||
Reference in New Issue
Block a user