261022_01_ENH: 태블릿에 대한 UI 분기 추가

This commit is contained in:
2026-10-22 09:07:40 +09:00
parent f0c9b02eae
commit 776a2930f5
11 changed files with 64 additions and 52 deletions

View File

@@ -27,7 +27,7 @@
## KART UI and data compatibility ## KART UI and data compatibility
- Preserve existing KART UI, colors and workflows; simple CSS is acceptable when the rendered result matches. Do not add controls or features absent from the original without approval. Legacy source is `../KART_FRONT/Report_React`; current backend contracts come from `../kart-server` controller, DTO and service sources, not historical migration notes or mocks. - Preserve existing KART UI, colors and workflows; simple CSS is acceptable when the rendered result matches. Do not add controls or features absent from the original without approval. Legacy source is `../KART_FRONT/Report_React`; current backend contracts come from `../kart-server` controller, DTO and service sources, not historical migration notes or mocks.
- Reuse project components before adding primitives. Do not overwrite locally edited registry copies or upgrade KriUiRegistry without approval. Use self-hosted Noto Sans/Noto Sans KR (`src/app/fonts.css`, `public/fonts`) and existing `globals.css` tokens; charts and word clouds wait for `useChartFont` readiness. Phone mode uses `(pointer: coarse) and (max-width: 767px)`. - Reuse project components before adding primitives. Do not overwrite locally edited registry copies or upgrade KriUiRegistry without approval. Use self-hosted Noto Sans/Noto Sans KR (`src/app/fonts.css`, `public/fonts`) and existing `globals.css` tokens; charts and word clouds wait for `useChartFont` readiness. Mobile mode uses `(hover: none) and (pointer: coarse), (max-width: 767px)` (touch device at any width, or any window ≤767px): Cross Tab shows bookmarks only, Tabulation/Derived/Exim show PcOnlyNotice, Quota/Current stay normal. Do not port legacy width-only hiding (media.css ≤1300/≤1050); mouse/trackpad windows wider than 767px keep full editing.
- Preserve empty/loading/error/retry states. Global loading uses `LoadingOverlayAdapter`; long statistics streams and Quota queries use inline loading with `meta.ignoreGlobalLoading`. Keep dnd-kit `DragOverlay` dropAnimation=null. - Preserve empty/loading/error/retry states. Global loading uses `LoadingOverlayAdapter`; long statistics streams and Quota queries use inline loading with `meta.ignoreGlobalLoading`. Keep dnd-kit `DragOverlay` dropAnimation=null.
- Display server count/percent/statistic strings without browser reaggregation or rounding. The legacy default shows percent in ordinary cells and N on the base line (TOTAL row, or TOTAL column when transposed). Preserve the empty top-left result cell and server merge metadata; do not fill it with the result title. - Display server count/percent/statistic strings without browser reaggregation or rounding. The legacy default shows percent in ordinary cells and N on the base line (TOTAL row, or TOTAL column when transposed). Preserve the empty top-left result cell and server merge metadata; do not fill it with the result title.
- Excel must preserve the existing workbook layout, cell types, merges, sheet ordering, links and images. Send `percentExact`/`statisticExact` for numeric cells, count strings for N, and the hidden TABULATION_0 table first. Use existing `report-excel.ts`, `download-name.ts` and download BFF helpers. Error responses must not become downloaded files. Use FormData/postForm without manually setting multipart boundaries. - Excel must preserve the existing workbook layout, cell types, merges, sheet ordering, links and images. Send `percentExact`/`statisticExact` for numeric cells, count strings for N, and the hidden TABULATION_0 table first. Use existing `report-excel.ts`, `download-name.ts` and download BFF helpers. Error responses must not become downloaded files. Use FormData/postForm without manually setting multipart boundaries.

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 9.7 KiB

View File

@@ -0,0 +1,4 @@
<svg width="69" height="61" viewBox="18 2 69 61" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M72.9 50.7778H24.1V14.1111H48.5L52.5 8H24.1C20.7145 8 18 10.7194 18 14.1111V50.7778C18 52.3985 18.6427 53.9529 19.7866 55.099C20.9306 56.245 22.4822 56.8889 24.1 56.8889H36.3V63H60.7V56.8889H72.9C76.255 56.8889 79 54.1389 79 50.7778V37.6111L72.9 41.6111V50.7778Z" fill="#989898"/>
<path d="M65.8333 2C61.7129 2 57.685 3.22185 54.259 5.51105C50.8329 7.80025 48.1627 11.054 46.5859 14.8608C45.009 18.6676 44.5965 22.8564 45.4003 26.8977C46.2042 30.939 48.1884 34.6511 51.102 37.5647C54.0155 40.4783 57.7277 42.4625 61.769 43.2664C65.8102 44.0702 69.9991 43.6576 73.8059 42.0808C77.6127 40.504 80.8664 37.8337 83.1556 34.4077C85.4448 30.9817 86.6667 26.9538 86.6667 22.8333C86.6667 20.0975 86.1278 17.3884 85.0808 14.8608C84.0339 12.3331 82.4993 10.0365 80.5647 8.10194C78.6302 6.16739 76.3335 4.63282 73.8059 3.58584C71.2783 2.53887 68.5692 2 65.8333 2ZM65.8333 33.25C65.4213 33.25 65.0185 33.1278 64.6759 32.8989C64.3333 32.67 64.0663 32.3446 63.9086 31.9639C63.7509 31.5832 63.7097 31.1644 63.79 30.7602C63.8704 30.3561 64.0688 29.9849 64.3602 29.6935C64.6516 29.4022 65.0228 29.2037 65.4269 29.1234C65.831 29.043 66.2499 29.0842 66.6306 29.2419C67.0113 29.3996 67.3367 29.6666 67.5656 30.0092C67.7945 30.3518 67.9167 30.7546 67.9167 31.1667C67.9167 31.7192 67.6972 32.2491 67.3065 32.6398C66.9158 33.0305 66.3859 33.25 65.8333 33.25ZM67.9167 24.9167C67.9167 25.4692 67.6972 25.9991 67.3065 26.3898C66.9158 26.7805 66.3859 27 65.8333 27C65.2808 27 64.7509 26.7805 64.3602 26.3898C63.9695 25.9991 63.75 25.4692 63.75 24.9167V14.5C63.75 13.9475 63.9695 13.4176 64.3602 13.0269C64.7509 12.6362 65.2808 12.4167 65.8333 12.4167C66.3859 12.4167 66.9158 12.6362 67.3065 13.0269C67.6972 13.4176 67.9167 13.9475 67.9167 14.5V24.9167Z" fill="#1CAE81"/>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -145,8 +145,12 @@ export function AppHeader({ user }: AppHeaderProps) {
<div className="mt-[2.5px] w-[400px] max-[1300px]:w-full"> <div className="mt-[2.5px] w-[400px] max-[1300px]:w-full">
{external ? <div className="h-8" /> : <ProjectSelector />} {external ? <div className="h-8" /> : <ProjectSelector />}
</div> </div>
<div className="mt-[2.5px] max-[1300px]:mt-1.5"> <div className="mt-[2.5px] w-full min-w-0 max-[1300px]:mt-1.5">
<h2 className="text-xl leading-[1.28571] font-bold break-all text-kart-title max-[1300px]:text-lg"> {/* One line; a long title ends with "..." and shows in full on hover. */}
<h2
title={projectTitle || undefined}
className="truncate text-xl leading-[1.28571] font-bold text-kart-title max-[1300px]:text-lg"
>
{projectTitle} {projectTitle}
</h2> </h2>
</div> </div>

View File

@@ -198,10 +198,10 @@ function Workspace({ project }: { project: ProjectRef }) {
aria-label="Create Variable" aria-label="Create Variable"
className="-mx-[1.0416vw] -mt-2.5 -mb-6 min-h-[calc(100vh-146px)] bg-white" className="-mx-[1.0416vw] -mt-2.5 -mb-6 min-h-[calc(100vh-146px)] bg-white"
> >
<div className="hidden [@media(pointer:coarse)_and_(max-width:767px)]:block"> <div className="hidden [@media(hover:none)_and_(pointer:coarse),(max-width:767px)]:block">
<PcOnlyNotice /> <PcOnlyNotice />
</div> </div>
<div className="flex items-start gap-[1.041vw] px-[1.0416vw] py-5 [@media(pointer:coarse)_and_(max-width:767px)]:hidden"> <div className="flex items-start gap-[1.041vw] px-[1.0416vw] py-5 [@media(hover:none)_and_(pointer:coarse),(max-width:767px)]:hidden">
<div className="w-[396px] shrink-0"> <div className="w-[396px] shrink-0">
<VariableList <VariableList
variables={variables.data} variables={variables.data}

View File

@@ -75,10 +75,10 @@ function Workspace({ project }: { project: ProjectRef }) {
aria-label="Export/Import" aria-label="Export/Import"
className="-mx-[1.0416vw] -mt-2.5 -mb-6 min-h-[calc(100vh-146px)] bg-white" className="-mx-[1.0416vw] -mt-2.5 -mb-6 min-h-[calc(100vh-146px)] bg-white"
> >
<div className="hidden [@media(pointer:coarse)_and_(max-width:767px)]:block"> <div className="hidden [@media(hover:none)_and_(pointer:coarse),(max-width:767px)]:block">
<PcOnlyNotice /> <PcOnlyNotice />
</div> </div>
<div className="flex items-start gap-4 px-[1.0416vw] py-5 [@media(pointer:coarse)_and_(max-width:767px)]:hidden"> <div className="flex items-start gap-4 px-[1.0416vw] py-5 [@media(hover:none)_and_(pointer:coarse),(max-width:767px)]:hidden">
<Column icon="/images/kart/ic_export.svg" title="Export"> <Column icon="/images/kart/ic_export.svg" title="Export">
<EximBox title="Data Export" info="Raw Data를 다운로드 받을 수 있습니다."> <EximBox title="Data Export" info="Raw Data를 다운로드 받을 수 있습니다.">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">

View File

@@ -13,6 +13,7 @@ import { bookmarkAxis, bookmarkTest, readBookmarkSetting } from "@/lib/bookmark-
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
import { bookmarkIndexes, crosstabBatch } from "./crosstab-conditions"; import { bookmarkIndexes, crosstabBatch } from "./crosstab-conditions";
import { ResultBlock } from "./LegacyResultTable"; import { ResultBlock } from "./LegacyResultTable";
import { MobileNotice } from "./ReportChrome";
import { plainText } from "./ReportResultView"; import { plainText } from "./ReportResultView";
/** /**
@@ -31,6 +32,19 @@ export function CrosstabPhone({
const bookmarks = list.data ?? []; const bookmarks = list.data ?? [];
const current = const current =
bookmarks.find((bookmark) => bookmark.bookmarkId === selectedId) ?? bookmarks[0]; bookmarks.find((bookmark) => bookmark.bookmarkId === selectedId) ?? bookmarks[0];
// Without the empty tab strip, so it sits at the same height as the PC-only notice.
if (!current) {
return (
<MobileNotice>
<p>
이 메뉴는 셋팅된 북마크만
<br />
확인 가능합니다.
</p>
<p className="mt-2">설정된 북마크가 없습니다.</p>
</MobileNotice>
);
}
return ( return (
<div className="min-h-[calc(100vh-146px)] bg-kart-bg"> <div className="min-h-[calc(100vh-146px)] bg-kart-bg">
<ul className="flex h-[60px] items-end gap-[30px] overflow-x-auto overflow-y-hidden bg-white px-4 [&::-webkit-scrollbar]:hidden"> <ul className="flex h-[60px] items-end gap-[30px] overflow-x-auto overflow-y-hidden bg-white px-4 [&::-webkit-scrollbar]:hidden">
@@ -56,25 +70,12 @@ export function CrosstabPhone({
); );
})} })}
</ul> </ul>
{current ? ( <PhoneBookmarkView
<PhoneBookmarkView key={current.bookmarkId}
key={current.bookmarkId} project={project}
project={project} bookmark={current}
bookmark={current} questions={questions}
questions={questions} />
/>
) : (
<div className="w-full bg-white pt-10 text-center">
<Image
src="/images/kart/icon_none_bookmark.svg"
alt="저장된 북마크가 없습니다."
width={102}
height={140}
className="inline-block h-[70vh] w-auto"
unoptimized
/>
</div>
)}
</div> </div>
); );
} }

View File

@@ -1,7 +1,7 @@
"use client"; "use client";
import Image from "next/image"; import Image from "next/image";
import { useEffect, useState } from "react"; import { useEffect, useState, type ReactNode } from "react";
import { Carousel, CarouselContent, CarouselItem, type CarouselApi } from "@/components/ui/carousel"; import { Carousel, CarouselContent, CarouselItem, type CarouselApi } from "@/components/ui/carousel";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
import type { Bookmark } from "@/types/bookmark"; import type { Bookmark } from "@/types/bookmark";
@@ -151,17 +151,27 @@ export function LeftToggleBox({ onExpand }: { onExpand: () => void }) {
); );
} }
/** Legacy mobile Tabulation: the PC-only illustration. */ /** Mobile-mode notice: the monitor icon with guide text, at one shared size and position. */
export function PcOnlyNotice() { export function MobileNotice({ children }: { children: ReactNode }) {
return ( return (
<div className="flex h-[80vh] items-center justify-center"> <div className="flex h-[80vh] flex-col items-center justify-center bg-white text-center">
<Image <Image src="/images/kart/icon_notice.svg" alt="" width={69} height={61} unoptimized />
src="/images/kart/icon_pc.svg" <div className="mt-5 text-[13px] leading-5 text-[#9e9e9e]">{children}</div>
alt="PC 화면에서 사용할 수 있습니다."
width={233}
height={140}
unoptimized
/>
</div> </div>
); );
} }
/** Legacy mobile Tabulation / Derived / Exim: PC-only notice. */
export function PcOnlyNotice() {
return (
<MobileNotice>
<p>
이 메뉴는 PC에서 접속하셔야만
<br />
사용하실 수 있습니다.
<br />
번거로우시겠지만, PC를 이용해 주세요.
</p>
</MobileNotice>
);
}

View File

@@ -69,8 +69,8 @@ export function ReportFrame({
aria-label={label} aria-label={label}
className="-mx-[1.0416vw] -mt-2.5 -mb-6 min-h-[calc(100vh-146px)] bg-white" className="-mx-[1.0416vw] -mt-2.5 -mb-6 min-h-[calc(100vh-146px)] bg-white"
> >
{/* Legacy shows reduced content on phones (small touch screens). */} {/* Reduced content on touch devices (phones and tablets) or windows 767px or narrower. */}
<div className="[@media(pointer:coarse)_and_(max-width:767px)]:hidden"> <div className="[@media(hover:none)_and_(pointer:coarse),(max-width:767px)]:hidden">
{tabs} {tabs}
<DndContext <DndContext
sensors={sensors} sensors={sensors}
@@ -124,7 +124,7 @@ export function ReportFrame({
</DragOverlay> </DragOverlay>
</DndContext> </DndContext>
</div> </div>
<div className="hidden [@media(pointer:coarse)_and_(max-width:767px)]:block"> <div className="hidden [@media(hover:none)_and_(pointer:coarse),(max-width:767px)]:block">
{phone} {phone}
</div> </div>
</section> </section>

View File

@@ -2,8 +2,11 @@
import { useSyncExternalStore } from "react"; import { useSyncExternalStore } from "react";
/** Same "small touch screen" test as the phone-only CSS in ReportFrame. */ /**
const PHONE_QUERY = "(pointer: coarse) and (max-width: 767px)"; * Same mobile test as the reduced-view CSS in ReportFrame: a touch device (phone/tablet) at any
* width, or any window 767px wide or narrower.
*/
const PHONE_QUERY = "(hover: none) and (pointer: coarse), (max-width: 767px)";
function subscribe(onChange: () => void) { function subscribe(onChange: () => void) {
const media = window.matchMedia(PHONE_QUERY); const media = window.matchMedia(PHONE_QUERY);