Compare commits

...

3 Commits

Author SHA1 Message Date
831f1fac6b Merge pull request 'develop' (#50) from develop into master
Reviewed-on: #50
2026-10-15 07:44:54 +09:00
81dd5165f3 261013_03_ENH: bfcache CTI 재로그인 확인용 임시 로그 제거
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-13 16:53:25 +09:00
59c9238632 261013_02_ENH: 리스트 관리·컨택 진행 화면 모바일 UI 개선
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-13 16:53:25 +09:00
8 changed files with 264 additions and 214 deletions

View File

@@ -174,12 +174,13 @@ const ListContactPageContent = () => {
return ( return (
<div className="space-y-6 text-sm"> <div className="space-y-6 text-sm">
<div className="flex items-center gap-3 w-1/2 pr-5"> {/* lg 미만은 아래 패널이 1열이므로 전체 폭을 쓰고, 한 줄에 들어가도록 글자/간격을 줄인다. */}
<div className="flex w-full items-center gap-2 lg:w-1/2 lg:gap-3 lg:pr-5">
<Button type="button" variant="outline" size="icon" onClick={handleGoToListManage} aria-label="목록으로"> <Button type="button" variant="outline" size="icon" onClick={handleGoToListManage} aria-label="목록으로">
<ArrowLeft className="h-4 w-4" /> <ArrowLeft className="h-4 w-4" />
</Button> </Button>
<h1 className="text-2xl font-bold tracking-tight">컨택 진행</h1> <h1 className="text-xl font-bold tracking-tight max-lg:whitespace-nowrap lg:text-2xl">컨택 진행</h1>
<span className="text-2xl font-bold tracking-tight">SID: {sid}</span> <span className="text-xl font-bold tracking-tight max-lg:min-w-0 max-lg:truncate lg:text-2xl">SID: {sid}</span>
<Button <Button
type="button" type="button"
variant="ghost" variant="ghost"

View File

@@ -336,6 +336,7 @@ const ListManagePage = () => {
initialSearchState={restoredForThisProject} initialSearchState={restoredForThisProject}
onSearchStateChange={setSearchUiState} onSearchStateChange={setSearchUiState}
focusRowId={restoredForThisProject?.sid} focusRowId={restoredForThisProject?.sid}
collapsibleFiltersOnMobile
/> />
{isInternal && ( {isInternal && (

View File

@@ -48,7 +48,10 @@ export function AppHeader({
const ctiConnectionStatus = useCtiConnectionStatus(); const ctiConnectionStatus = useCtiConnectionStatus();
const isCtiConnected = ctiConnectionStatus === "open"; const isCtiConnected = ctiConnectionStatus === "open";
const showProjectTitle = isViewProjectTitle && !!projectName;
return ( return (
<>
<KriHeader <KriHeader
logo={ logo={
<div className="flex h-10 w-20 items-center justify-center"> <div className="flex h-10 w-20 items-center justify-center">
@@ -72,8 +75,8 @@ export function AppHeader({
className="border-gray-200 bg-white" className="border-gray-200 bg-white"
innerClassName="h-16 px-4" innerClassName="h-16 px-4"
center={ center={
isViewProjectTitle && projectName ? ( showProjectTitle ? (
<h1 className="ml-3 text-2xl font-bold">{projectName}</h1> <h1 className="ml-3 hidden truncate text-2xl font-bold lg:block" title={projectName}>{projectName}</h1>
) : null ) : null
} }
right={ right={
@@ -112,5 +115,12 @@ export function AppHeader({
</> </>
} }
/> />
{/* 모바일(lg 미만)은 헤더 공간이 좁아 프로젝트명을 헤더 아래 한 줄로 내려 표시한다. */}
{showProjectTitle ? (
<div className="border-b border-gray-200 bg-white px-4 py-2 lg:hidden">
<h1 className="truncate text-center text-lg font-bold" title={projectName}>{projectName}</h1>
</div>
) : null}
</>
); );
} }

View File

@@ -154,6 +154,11 @@ export default function AppMainLayout({ children, initialFontSize }: AppMainLayo
setFontSize(Math.min(FONT_SIZE.MAX, fontSize + 2)); setFontSize(Math.min(FONT_SIZE.MAX, fontSize + 2));
}; };
// 모바일(lg 미만)에서는 사이드바가 본문을 덮는 오버레이라 메뉴를 접힌 상태로 시작한다.
useEffect(() => {
if (!window.matchMedia("(min-width: 64rem)").matches) setMenuOpen(false);
}, []);
useEffect(() => { useEffect(() => {
if (!mounted) return; if (!mounted) return;

View File

@@ -79,7 +79,7 @@ const FieldRow = ({ label, editable, children }: { label: string; editable?: boo
<Label <Label
className={cn( className={cn(
'w-24 shrink-0 rounded-md px-2 py-2.5 text-sm font-bold text-foreground', 'w-24 shrink-0 rounded-md px-2 py-2.5 text-sm font-bold text-foreground',
editable && 'bg-blue-100 text-black', editable && 'bg-blue-100',
)} )}
> >
{label} {label}
@@ -215,13 +215,15 @@ const ListContactInfoPanel = ({
if (header.listHderTy === ListHeaderConst.TEL_NUM) { if (header.listHderTy === ListHeaderConst.TEL_NUM) {
return ( return (
<FieldRow key={header.listHderId} label={header.listHderNm} editable={canEditField}> <FieldRow key={header.listHderId} label={header.listHderNm} editable={canEditField}>
<div className="flex gap-2"> {/* 모바일(md 미만)은 버튼을 입력란 아래 줄로 내린다. */}
<div className="flex flex-col gap-2 md:flex-row">
<Input <Input
value={formatKoreanPhoneNumber(value)} value={formatKoreanPhoneNumber(value)}
readOnly={!editable} readOnly={!editable}
onChange={(e) => onChange(e.target.value.replace(/\D/g, ''))} onChange={(e) => onChange(e.target.value.replace(/\D/g, ''))}
className={readOnlyContrastClass} className={readOnlyContrastClass}
/> />
<div className="flex shrink-0 flex-wrap gap-2">
<Button <Button
type="button" type="button"
variant="outline" variant="outline"
@@ -254,6 +256,7 @@ const ListContactInfoPanel = ({
알림톡 알림톡
</Button> </Button>
</div> </div>
</div>
{(isDialing || isOnCall) && {(isDialing || isOnCall) &&
<p className="text-sm text-red-600 font-medium mt-1"> <p className="text-sm text-red-600 font-medium mt-1">
⚠️ 전화를 끊어야만 통화 종료가 기록됩니다. ⚠️ 전화를 끊어야만 통화 종료가 기록됩니다.
@@ -266,13 +269,14 @@ const ListContactInfoPanel = ({
if (header.listHderTy === ListHeaderConst.EMAIL) { if (header.listHderTy === ListHeaderConst.EMAIL) {
return ( return (
<FieldRow key={header.listHderId} label={header.listHderNm} editable={canEditField}> <FieldRow key={header.listHderId} label={header.listHderNm} editable={canEditField}>
<div className="flex gap-2"> <div className="flex flex-col gap-2 md:flex-row">
<Input <Input
value={value} value={value}
readOnly={!editable} readOnly={!editable}
onChange={(e) => onChange(e.target.value)} onChange={(e) => onChange(e.target.value)}
className={readOnlyContrastClass} className={readOnlyContrastClass}
/> />
<div className="flex shrink-0 gap-2">
<Button <Button
type="button" type="button"
variant="outline" variant="outline"
@@ -284,6 +288,7 @@ const ListContactInfoPanel = ({
발송 발송
</Button> </Button>
</div> </div>
</div>
</FieldRow> </FieldRow>
) )
} }
@@ -367,6 +372,8 @@ const ListContactInfoPanel = ({
return ( return (
<FieldRow key={survey.prjctSurveyIdx ?? survey.surveyOrder} label={survey.surveyName || 'Web'}> <FieldRow key={survey.prjctSurveyIdx ?? survey.surveyOrder} label={survey.surveyName || 'Web'}>
{/* 모바일(md 미만)은 응답 상태를 버튼 아래 줄로 내린다. */}
<div className="flex flex-col items-start gap-2 md:flex-row md:items-center">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<Button type="button" className="gap-2" disabled={isEditing} onClick={() => handleStartSurvey(survey)}> <Button type="button" className="gap-2" disabled={isEditing} onClick={() => handleStartSurvey(survey)}>
조사 시작 조사 시작
@@ -375,6 +382,7 @@ const ListContactInfoPanel = ({
<QrCode className="h-4 w-4" /> <QrCode className="h-4 w-4" />
QR QR
</Button> </Button>
</div>
{hasSurveyResponse ? ( {hasSurveyResponse ? (
<span className="text-sm"> <span className="text-sm">
[{resultCodes.find((rc) => rc.resultCdTy === ResultCodeType.SURVEY && rc.resultCd === result.lastResultCd) [{resultCodes.find((rc) => rc.resultCdTy === ResultCodeType.SURVEY && rc.resultCd === result.lastResultCd)

View File

@@ -2,7 +2,8 @@
import { useCallback, useEffect, useMemo, useRef, useState, type ClipboardEvent, type ReactNode } from 'react' import { useCallback, useEffect, useMemo, useRef, useState, type ClipboardEvent, type ReactNode } from 'react'
import type { PaginationState, SortingState } from '@tanstack/react-table' import type { PaginationState, SortingState } from '@tanstack/react-table'
import { Funnel, PencilLine } from 'lucide-react' import { ChevronDown, Funnel, PencilLine } from 'lucide-react'
import { Badge } from '@/components/ui/badge'
import { Button } from '@/components/ui/button' import { Button } from '@/components/ui/button'
import { Input } from '@/components/ui/input' import { Input } from '@/components/ui/input'
import { Popover, PopoverAnchor, PopoverContent } from '@/components/ui/popover' import { Popover, PopoverAnchor, PopoverContent } from '@/components/ui/popover'
@@ -13,6 +14,7 @@ import KriDateRangePicker, { type KriDateRange } from '@/components/common/KriDa
import ListBatchEditDialog, { type BatchEditPayload, type BatchEditResultCodes, type BatchEditRow, type BatchEditSurveyResultCodes } from '@/components/dialog/ListBatchEditDialog' import ListBatchEditDialog, { type BatchEditPayload, type BatchEditResultCodes, type BatchEditRow, type BatchEditSurveyResultCodes } from '@/components/dialog/ListBatchEditDialog'
import ListFilterDialog, { operatorLabel } from '@/components/dialog/ListFilterDialog' import ListFilterDialog, { operatorLabel } from '@/components/dialog/ListFilterDialog'
import { useDialog } from '@/hooks/useDialog' import { useDialog } from '@/hooks/useDialog'
import { cn } from '@/lib/utils'
import { useListSearchQuery, useUpdateListMutation } from '@/query/list' import { useListSearchQuery, useUpdateListMutation } from '@/query/list'
import { getListColumns, LIST_IS_USE_LABEL, type ListTableRow } from '@/components/table-column/ListTableColumn' import { getListColumns, LIST_IS_USE_LABEL, type ListTableRow } from '@/components/table-column/ListTableColumn'
import { useAssignTargetRows } from '@/components/assign/AssignTargetList' import { useAssignTargetRows } from '@/components/assign/AssignTargetList'
@@ -72,6 +74,8 @@ export type ListSearchTableProps = {
initialSearchState?: ListSearchUiState initialSearchState?: ListSearchUiState
onSearchStateChange?: (state: ListSearchUiState) => void onSearchStateChange?: (state: ListSearchUiState) => void
focusRowId?: string focusRowId?: string
/** 모바일(md 미만)에서 기본 검색 필터를 1열로 쌓고 접기/펼치기 토글을 노출한다. */
collapsibleFiltersOnMobile?: boolean
} }
const toSidSet = (value: string) => const toSidSet = (value: string) =>
@@ -197,8 +201,10 @@ export function ListSearchTable({
initialSearchState, initialSearchState,
onSearchStateChange, onSearchStateChange,
focusRowId, focusRowId,
collapsibleFiltersOnMobile = false,
}: ListSearchTableProps) { }: ListSearchTableProps) {
const { showDialog } = useDialog() const { showDialog } = useDialog()
const [filtersOpen, setFiltersOpen] = useState(true)
const [searchText, setSearchText] = useState(initialSearchState?.searchText ?? '') const [searchText, setSearchText] = useState(initialSearchState?.searchText ?? '')
const [showSidHangulHint, setShowSidHangulHint] = useState(false) const [showSidHangulHint, setShowSidHangulHint] = useState(false)
const [searchContactResult, setSearchContactResult] = useState<string[]>(initialSearchState?.searchContactResult ?? []) const [searchContactResult, setSearchContactResult] = useState<string[]>(initialSearchState?.searchContactResult ?? [])
@@ -696,11 +702,54 @@ export function ListSearchTable({
resetToFirstPage() resetToFirstPage()
}, [externalAssignFilter]) }, [externalAssignFilter])
// md 이상에서는 기존 클래스와 동일하게 렌더링되도록 모바일 전용 값만 분기한다.
const filterRowClassName = collapsibleFiltersOnMobile
? 'flex flex-col gap-2 md:flex-row md:flex-wrap md:items-center'
: 'flex items-center gap-2 flex-wrap'
const filterItemClassName = collapsibleFiltersOnMobile
? 'w-full md:w-auto md:flex-1 md:min-w-0 md:max-w-xs'
: 'flex-1 min-w-0 max-w-xs'
const dateFilterClassName = collapsibleFiltersOnMobile
? 'w-full md:w-auto md:flex-1 md:min-w-[240px] md:max-w-xs'
: 'flex-1 min-w-[240px] max-w-xs'
const surveyFilterClassName = collapsibleFiltersOnMobile
? 'w-full md:w-auto md:flex-1 md:min-w-[180px] md:max-w-xs'
: 'flex-1 min-w-[180px] max-w-xs'
// 접힌 상태에서도 기본 검색 조건 적용 여부를 알 수 있도록 토글 버튼에 표시한다.
const hasActiveFilters =
searchText.trim().length > 0 ||
searchContactResult.length > 0 ||
Boolean(searchContactDateRange.from || searchContactDateRange.to) ||
(fieldInterviewEnabled && searchInterviewResult.length > 0) ||
Object.values(surveyResultSelections).some((values) => values.length > 0)
return ( return (
<div className="space-y-2"> <div className="space-y-2">
<div className="space-y-2"> <div className="space-y-2">
<div className="flex items-center gap-2 flex-wrap"> {collapsibleFiltersOnMobile ? (
<div className="flex-1 min-w-0 max-w-xs"> <Button
type="button"
variant="outline"
className="w-full justify-between md:hidden"
aria-expanded={filtersOpen}
aria-controls="list-search-filters"
onClick={() => setFiltersOpen((prev) => !prev)}
>
<span className="flex items-center gap-2">
검색 조건
{hasActiveFilters ? <Badge>적용 중</Badge> : null}
</span>
<ChevronDown className={cn('h-4 w-4 transition-transform', filtersOpen && 'rotate-180')} />
</Button>
) : null}
<div
id="list-search-filters"
className={cn('space-y-2', collapsibleFiltersOnMobile && !filtersOpen && 'hidden md:block')}
>
<div className={filterRowClassName}>
<div className={filterItemClassName}>
<Popover open={showSidHangulHint}> <Popover open={showSidHangulHint}>
<PopoverAnchor asChild> <PopoverAnchor asChild>
<Input <Input
@@ -720,7 +769,7 @@ export function ListSearchTable({
</PopoverContent> </PopoverContent>
</Popover> </Popover>
</div> </div>
<div className="flex-1 min-w-0 max-w-xs"> <div className={filterItemClassName}>
<KriMultiSelect <KriMultiSelect
items={resultCodes.filter((item) => item.resultCdTy === ResultCodeType.CONTACT)} items={resultCodes.filter((item) => item.resultCdTy === ResultCodeType.CONTACT)}
value={searchContactResult} value={searchContactResult}
@@ -739,10 +788,10 @@ export function ListSearchTable({
setPagination((prev) => ({ ...prev, pageIndex: 0 })) setPagination((prev) => ({ ...prev, pageIndex: 0 }))
}} }}
placeholder="컨택 일자" placeholder="컨택 일자"
className="flex-1 min-w-[240px] max-w-xs" className={dateFilterClassName}
/> />
{fieldInterviewEnabled ? ( {fieldInterviewEnabled ? (
<div className="flex-1 min-w-0 max-w-xs"> <div className={filterItemClassName}>
<KriMultiSelect <KriMultiSelect
items={resultCodes.filter((item) => item.resultCdTy === ResultCodeType.INTERVIEW)} items={resultCodes.filter((item) => item.resultCdTy === ResultCodeType.INTERVIEW)}
value={searchInterviewResult} value={searchInterviewResult}
@@ -758,11 +807,11 @@ export function ListSearchTable({
</div> </div>
{surveys.length > 0 ? ( {surveys.length > 0 ? (
<div className="flex items-center gap-2 flex-wrap"> <div className={filterRowClassName}>
{surveys {surveys
.filter((survey) => survey.prjctSurveyIdx != null) .filter((survey) => survey.prjctSurveyIdx != null)
.map((survey) => ( .map((survey) => (
<div key={survey.prjctSurveyIdx} className="flex-1 min-w-[180px] max-w-xs"> <div key={survey.prjctSurveyIdx} className={surveyFilterClassName}>
<KriMultiSelect <KriMultiSelect
items={surveyResultCodeOptions} items={surveyResultCodeOptions}
value={surveyResultSelections[survey.prjctSurveyIdx as number] ?? []} value={surveyResultSelections[survey.prjctSurveyIdx as number] ?? []}
@@ -777,6 +826,7 @@ export function ListSearchTable({
))} ))}
</div> </div>
) : null} ) : null}
</div>
<div className="flex items-center gap-2 flex-wrap justify-between"> <div className="flex items-center gap-2 flex-wrap justify-between">
<div className="flex items-center gap-2 flex-wrap"> <div className="flex items-center gap-2 flex-wrap">

View File

@@ -43,30 +43,10 @@ export function useCtiConnection() {
// 뒤로/앞으로 가기로 bfcache에 들어갔다가 돌아오면 React 상태가 그대로 복원되어 위 effect가 다시 실행되지 않는다. // 뒤로/앞으로 가기로 bfcache에 들어갔다가 돌아오면 React 상태가 그대로 복원되어 위 effect가 다시 실행되지 않는다.
// 떠날 때 CTI 서버에 Logout, 돌아올 때 다시 Login 하여 새로고침 없이 전화걸기를 쓸 수 있게 한다. // 떠날 때 CTI 서버에 Logout, 돌아올 때 다시 Login 하여 새로고침 없이 전화걸기를 쓸 수 있게 한다.
useEffect(() => { useEffect(() => {
// TEMP_CTI_LOG: pagehide 시점 로그가 콘솔에 남지 않아, 떠날 때 정보를 sessionStorage에 남기고 돌아오거나 다시 로드될 때 출력한다.
const PAGEHIDE_DEBUG_KEY = "__cti_pagehide_debug"; // TEMP_CTI_LOG
const printLastPageHide = (from: string) => {
const saved = sessionStorage.getItem(PAGEHIDE_DEBUG_KEY);
if (!saved) return;
console.log(`[CTI][TEMP_LOG] last pagehide (${from}) ->`, JSON.parse(saved)); // TEMP_CTI_LOG
sessionStorage.removeItem(PAGEHIDE_DEBUG_KEY);
};
printLastPageHide("mount");
console.log("[CTI][TEMP_LOG] page lifecycle listeners registered"); // TEMP_CTI_LOG
const handlePageHide = (event: PageTransitionEvent) => { const handlePageHide = (event: PageTransitionEvent) => {
console.log("[CTI][TEMP_LOG] pagehide, persisted =", event.persisted); // TEMP_CTI_LOG
sessionStorage.setItem(PAGEHIDE_DEBUG_KEY, JSON.stringify({
persisted: event.persisted,
at: new Date().toISOString(),
path: window.location.pathname,
connectionState: ctiClient.getConnectionState(),
})); // TEMP_CTI_LOG
if (event.persisted) ctiClient.suspendForPageHide(); if (event.persisted) ctiClient.suspendForPageHide();
}; };
const handlePageShow = (event: PageTransitionEvent) => { const handlePageShow = (event: PageTransitionEvent) => {
console.log("[CTI][TEMP_LOG] pageshow, persisted =", event.persisted); // TEMP_CTI_LOG
printLastPageHide("pageshow");
if (event.persisted) ctiClient.resumeFromPageShow(); if (event.persisted) ctiClient.resumeFromPageShow();
}; };

View File

@@ -769,13 +769,9 @@ const connectAndLogin = (params: CtiLoginParams) => {
const suspendForPageHide = () => { const suspendForPageHide = () => {
if (!currentLoginParams) return; if (!currentLoginParams) return;
stopReconnectLoop(); stopReconnectLoop();
if (currentAgentLoginId && connectionState === "open") { if (currentAgentLoginId && connectionState === "open" && !isCallInProgress()) {
if (isCallInProgress()) {
console.log("[CTI][TEMP_LOG] pagehide logout skipped, call is in progress"); // TEMP_CTI_LOG
} else {
send({ ZCommand: "Logout", AgentLoginID: currentAgentLoginId }); send({ ZCommand: "Logout", AgentLoginID: currentAgentLoginId });
} }
}
teardownSocket(); teardownSocket();
}; };
@@ -784,7 +780,6 @@ const resumeFromPageShow = () => {
const params = currentLoginParams; const params = currentLoginParams;
if (!params) return; if (!params) return;
if (connectionState === "open" || connectionState === "connecting") return; if (connectionState === "open" || connectionState === "connecting") return;
console.log("[CTI][TEMP_LOG] pageshow resume, reconnecting"); // TEMP_CTI_LOG
connectAndLogin(params); connectAndLogin(params);
}; };