From 6f1b7423ecaa2087171811f066412f63820f35b1 Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Fri, 23 Oct 2026 11:52:59 +0900 Subject: [PATCH] =?UTF-8?q?261023=5F01=5FENH:=20=ED=94=84=EB=A1=9C?= =?UTF-8?q?=EC=A0=9D=ED=8A=B8=C2=B7=ED=95=84=ED=84=B0=20=EC=84=A0=ED=83=9D?= =?UTF-8?q?=20=EC=98=B5=EC=85=98=20=EC=A0=84=EC=B2=B4=20=EC=A0=9C=EB=AA=A9?= =?UTF-8?q?=20=ED=88=B4=ED=8C=81=20=EB=B3=B5=EC=9B=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AGENTS.md | 32 ++++++++++++ src/components/common/KriAutoComplete.tsx | 14 +++++- .../common/multi-select/MultiSelect.tsx | 4 ++ .../multi-select/MultiSelectContent.tsx | 49 +++++++++++++++++-- src/components/common/multi-select/index.ts | 1 + src/components/common/multi-select/types.ts | 3 ++ src/components/project/ProjectSelector.tsx | 3 ++ src/components/report/FilterPopup.tsx | 6 +++ 8 files changed, 107 insertions(+), 5 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 21df77f..5d5b5bc 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -265,6 +265,26 @@ Before each related task, read the current contents of every matching reference, If a task spans multiple scopes, read every matching reference. Generated files under `.agent-harness/references/` are read-only copies; edit KriFrontCommon's `.agent/consumer.md` or `.agent/consumer-references/` and recompose instead. +## Noti-hub SMS Types + +- `MessageType.SMS = 21`, `LMS = 22`, `MMS = 23`; `ChannelType.SMS = 2` is unchanged. `SMS_TYPE_ARRAY` and `SmsType` include all three. +- `LMS_MMS = 22` remains a deprecated source-compatibility alias for LMS only. It does not represent MMS. Enum reverse lookup for 22 returns LMS. Use numeric bulk-list paths; the server no longer accepts LMS_MMS in paths. Numeric 21/22/23 bulk-list requests all return the entire SMS channel, not type-filtered lists. +- Requests retain their existing URLs/body shapes. The server chooses the actual type per recipient after substitution: attachment -> MMS; otherwise title or UTF-8 body >= 90 bytes -> LMS; otherwise SMS. +- Refresh templates from the save response (`tmplatTy`); display actual delivery types from `sendTy`, not the template or result code. A bulk can contain multiple SMS types. LMS/MMS share result codes; use existing server result labels. +- SMS, LMS, MMS and KKO use cancellation code 9998. Verify with `npm run typecheck`, `npm run build`, and `node --test tests/noti-hub-sms.test.mjs`. + +## Noti-hub Reservation Cancellation + +- Import cancellation types, constants, and helpers from `@kri/common/noti-hub` only. They are runtime-neutral and require no optional peers. +- Individual current cancellation state is determined by resultCode via isReserveCanceledResult; bulk current state is cancellationStatus (NONE/PARTIAL/ALL). These describe current cancellation state, not cancellation eligibility. cancelDt and cancelUser are request history, not current state. +- SendResultInfo, SendInfo, and BulkSendInfo expose optional cancelable. Use isSendCancelable(item), which returns true only for cancelable === true, for cancellation eligibility; missing values from older responses are treated as false. Never infer eligibility from cancelDt, result labels, or result codes. +- cancelable reflects query-time state and may change before cancellation. Determine the final outcome from SendCancelResponse counts. +- sendIdx is the single-cancel identifier, not cmid. It is absent from the latest abbreviated report (/api/v1/report/last/send/...). Request sendIdx must be a positive integer; bulkSendKey is required and at most 32 characters. +- EMAIL_RESERVE_CANCELED_RESULT_CODE is 108 for EMAIL. SMS_KKO_RESERVE_CANCELED_RESULT_CODE is 9998 for SMS, LMS, MMS, and KKO. Unknown message types are not recognized as canceled. +- Display the server's resultViewLabel/resultLabel ("예약 취소"). There is no separate result-code list API. +- HTTP 200 can contain notCancelableCount. parseSendCancelResponse validates nonnegative integer counts and targetCount = canceledCount + alreadyCanceledCount + notCancelableCount, throwing TypeError on invalid data. Bulk targetCount counts currently registered detail rows; response canceledCount counts only cancellations made by that request. +- Existing response fields are unchanged; all added fields on existing types are optional. Verify with npm run typecheck and npm run build. + ## HTTP Streaming - `@kri/common/http` HTTP clients expose streamGet/streamPost/streamPut/streamPatch/streamDel, returning HttpStreamResponse (status, statusText, headers, url, nullable body). @@ -288,6 +308,18 @@ When implementing or changing frontend UI, use this order: - `kri-auto-complete` exposes `resetScrollOnSearch?: boolean` on `KriSingleSelect`, `KriMultiSelect`, and `MultiSelect`. It defaults to `false`, preserving existing behavior. - When enabled, a search value change (including clearing it) resets the option list scroll to the top on the next animation frame in both `filter` and `inputOnly` modes. Async result updates alone do not trigger another reset. +### KriAutoComplete Option Tooltip + +- `kri-auto-complete` exposes `optionTooltip?: 'singleLine' | 'wrap'` and `optionTooltipClassName?: string` on `KriSingleSelect`, `KriMultiSelect`, and `MultiSelect`. It is off by default, preserving existing behavior. +- When enabled, hovering an option shows its full `label` in a right-side tooltip. `singleLine` stays on one line until the available viewport width; `wrap` wraps at 28rem. The item depends on the shadcn `tooltip` component and provides its own `TooltipProvider`. + +### KriEditor SMS Preview + +- `changeSmsType` reports `SMS | LMS | MMS`. Update consumer callbacks to handle `MMS`; this widens the previous callback contract. +- Attachment presence (`smsHasAttachment`) takes priority and reports MMS. Otherwise a title or UTF-8 preview size >= `smsMaxBytes` (default 90) reports LMS; the remainder reports SMS. LMS/MMS share `lmsMaxBytes` (default 2000). +- UTF-8 byte counting includes `smsPreviewSuffix` and its separating newline, without storing the suffix in the body. +- This is a preview. Use the template-save response for saved `tmplatTy` and delivery-result `sendTy` for actual per-recipient type after server substitution. Registry updates require updating installed consumer copies. + ### Required Shared References Before each related task, read the current contents of every matching reference, even if it was read earlier in the session. diff --git a/src/components/common/KriAutoComplete.tsx b/src/components/common/KriAutoComplete.tsx index 5212f97..cec733e 100644 --- a/src/components/common/KriAutoComplete.tsx +++ b/src/components/common/KriAutoComplete.tsx @@ -3,9 +3,9 @@ import * as React from 'react' import { cn } from '@/lib/utils' import { MultiSelect } from '@/components/common/multi-select' -import type { MultiSelectOption, MultiSelectRef } from '@/components/common/multi-select' +import type { MultiSelectOption, MultiSelectOptionTooltip, MultiSelectRef } from '@/components/common/multi-select' -export type { MultiSelectOption, MultiSelectRef } from '@/components/common/multi-select' +export type { MultiSelectOption, MultiSelectOptionTooltip, MultiSelectRef } from '@/components/common/multi-select' export interface KriAutoCompleteBaseProps { items: T[] @@ -26,6 +26,8 @@ export interface KriAutoCompleteBaseProps { disabled?: boolean 'aria-invalid'?: boolean modalPopover?: boolean + optionTooltip?: MultiSelectOptionTooltip + optionTooltipClassName?: string } export interface KriMultiSelectProps extends KriAutoCompleteBaseProps { @@ -77,6 +79,8 @@ export function KriMultiSelect({ disabled, 'aria-invalid': ariaInvalid, modalPopover = true, + optionTooltip, + optionTooltipClassName, }: KriMultiSelectProps) { const options = React.useMemo( () => toOptions(items, getValue, getLabel, withInfo), @@ -110,6 +114,8 @@ export function KriMultiSelect({ disabled={disabled} aria-invalid={ariaInvalid} modalPopover={modalPopover} + optionTooltip={optionTooltip} + optionTooltipClassName={optionTooltipClassName} /> ) @@ -157,6 +163,8 @@ function KriSingleSelectInner({ disabled, 'aria-invalid': ariaInvalid, modalPopover = true, + optionTooltip, + optionTooltipClassName, }: KriSingleSelectProps, forwardedRef: React.ForwardedRef) { const ref = React.useRef(null) React.useImperativeHandle( @@ -227,6 +235,8 @@ function KriSingleSelectInner({ aria-invalid={ariaInvalid} title={showSelectedTooltip ? selectedLabel ?? value : undefined} modalPopover={modalPopover} + optionTooltip={optionTooltip} + optionTooltipClassName={optionTooltipClassName} /> ) diff --git a/src/components/common/multi-select/MultiSelect.tsx b/src/components/common/multi-select/MultiSelect.tsx index b4731d7..53c7207 100644 --- a/src/components/common/multi-select/MultiSelect.tsx +++ b/src/components/common/multi-select/MultiSelect.tsx @@ -46,6 +46,8 @@ function MultiSelectInner( closeOnSelect = false, preventDeselect = false, hideOptionCheck = false, + optionTooltip, + optionTooltipClassName, style, ...buttonProps }: MultiSelectProps, @@ -205,6 +207,8 @@ function MultiSelectInner( onSearchValueChange={handleSearchChange} hideSelectAll={hideSelectAll} hideOptionCheck={hideOptionCheck} + optionTooltip={optionTooltip} + optionTooltipClassName={optionTooltipClassName} selectionMode={selectionMode} emptyIndicator={emptyIndicator} onToggleOption={toggleOption} diff --git a/src/components/common/multi-select/MultiSelectContent.tsx b/src/components/common/multi-select/MultiSelectContent.tsx index df0cec8..27957f5 100644 --- a/src/components/common/multi-select/MultiSelectContent.tsx +++ b/src/components/common/multi-select/MultiSelectContent.tsx @@ -11,8 +11,9 @@ import { CommandList, CommandSeparator, } from '@/components/ui/command' +import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip' import { cn } from '@/lib/utils' -import type { MultiSelectGroup, MultiSelectOption, MultiSelectOptions } from './types' +import type { MultiSelectGroup, MultiSelectOption, MultiSelectOptionTooltip, MultiSelectOptions } from './types' import { isGroupedOptions } from './utils' interface MultiSelectContentProps { @@ -25,25 +26,57 @@ interface MultiSelectContentProps { onSearchValueChange: (value: string) => void hideSelectAll: boolean hideOptionCheck: boolean + optionTooltip?: MultiSelectOptionTooltip + optionTooltipClassName?: string selectionMode: 'single' | 'multiple' emptyIndicator: React.ReactNode onToggleOption: (option: MultiSelectOption) => void onToggleAll: () => void } +interface OptionTooltipSettings { + mode: MultiSelectOptionTooltip + className?: string +} + function OptionItem({ option, selected, hideOptionCheck, + tooltip, onToggle, }: { option: MultiSelectOption selected: boolean hideOptionCheck: boolean + tooltip?: OptionTooltipSettings onToggle: () => void }) { const Icon = option.icon + // cmdk's CommandItem overrides onPointerMove, so the label (not the item) is the tooltip trigger. + const label = tooltip ? ( + + + {option.label} + + + {option.label} + + + ) : ( + {option.label} + ) + return ( ({ ) : null} {Icon ? : null} - {option.label} + {label} ) } @@ -71,11 +104,13 @@ function OptionsGroup({ group, selectedValues, hideOptionCheck, + tooltip, onToggleOption, }: { group: MultiSelectGroup selectedValues: string[] hideOptionCheck: boolean + tooltip?: OptionTooltipSettings onToggleOption: (option: MultiSelectOption) => void }) { return ( @@ -86,6 +121,7 @@ function OptionsGroup({ option={option} selected={selectedValues.includes(option.value)} hideOptionCheck={hideOptionCheck} + tooltip={tooltip} onToggle={() => onToggleOption(option)} /> ))} @@ -103,6 +139,8 @@ export function MultiSelectContent({ onSearchValueChange, hideSelectAll, hideOptionCheck, + optionTooltip, + optionTooltipClassName, selectionMode, emptyIndicator, onToggleOption, @@ -123,8 +161,9 @@ export function MultiSelectContent({ const flatOptions = grouped ? options.flatMap((group) => group.options) : options const selectableOptions = flatOptions.filter((option) => !option.disabled) const allSelected = selectableOptions.length > 0 && selectableOptions.every((option) => selectedValues.includes(option.value)) + const tooltip = optionTooltip ? { mode: optionTooltip, className: optionTooltipClassName } : undefined - return ( + const content = ( {searchable ? ( ({ group={group} selectedValues={selectedValues} hideOptionCheck={hideOptionCheck} + tooltip={tooltip} onToggleOption={onToggleOption} /> )) @@ -172,6 +212,7 @@ export function MultiSelectContent({ option={option} selected={selectedValues.includes(option.value)} hideOptionCheck={hideOptionCheck} + tooltip={tooltip} onToggle={() => onToggleOption(option)} /> ))} @@ -180,4 +221,6 @@ export function MultiSelectContent({ ) + + return tooltip ? {content} : content } diff --git a/src/components/common/multi-select/index.ts b/src/components/common/multi-select/index.ts index 6392afd..a630b2f 100644 --- a/src/components/common/multi-select/index.ts +++ b/src/components/common/multi-select/index.ts @@ -3,6 +3,7 @@ export type { AnimationConfig, MultiSelectGroup, MultiSelectOption, + MultiSelectOptionTooltip, MultiSelectOptions, MultiSelectProps, MultiSelectRef, diff --git a/src/components/common/multi-select/types.ts b/src/components/common/multi-select/types.ts index 7d6abbb..4fedf04 100644 --- a/src/components/common/multi-select/types.ts +++ b/src/components/common/multi-select/types.ts @@ -29,6 +29,7 @@ export interface MultiSelectGroup { export type MultiSelectOptions = MultiSelectOption[] | MultiSelectGroup[] export type MultiSelectSelectionMode = 'single' | 'multiple' export type MultiSelectVariant = 'default' | 'secondary' | 'destructive' | 'inverted' +export type MultiSelectOptionTooltip = 'singleLine' | 'wrap' export interface MultiSelectResponsiveSettings { maxCount?: number @@ -79,6 +80,8 @@ export interface MultiSelectProps closeOnSelect?: boolean preventDeselect?: boolean hideOptionCheck?: boolean + optionTooltip?: MultiSelectOptionTooltip + optionTooltipClassName?: string } export interface MultiSelectRef { diff --git a/src/components/project/ProjectSelector.tsx b/src/components/project/ProjectSelector.tsx index 7a8f93e..12375eb 100644 --- a/src/components/project/ProjectSelector.tsx +++ b/src/components/project/ProjectSelector.tsx @@ -50,6 +50,9 @@ export function ProjectSelector() { spanClassName="text-sm [&_span]:text-kart-text" searchable resetScrollOnSearch + // Legacy react-tooltip: full "(pkey) title" on hover, right side, 65% opacity. + optionTooltip="singleLine" + optionTooltipClassName="opacity-65" preventDeselect hideOptionCheck disabled={projects.isPending} diff --git a/src/components/report/FilterPopup.tsx b/src/components/report/FilterPopup.tsx index 0150d42..92a894d 100644 --- a/src/components/report/FilterPopup.tsx +++ b/src/components/report/FilterPopup.tsx @@ -245,6 +245,9 @@ function FilterLineRow({ searchable preventDeselect hideOptionCheck + // Legacy QuestionSelect tooltip: full title on hover. + optionTooltip="singleLine" + optionTooltipClassName="opacity-65" onChange={(qid) => { const selected = questions.find((item) => item.qid === qid); if (!selected) return; @@ -302,6 +305,9 @@ function FilterLineRow({ badgeClassName="text-xs" maxSelected={multi ? undefined : 1} hideSelectAll={!multi} + // Legacy ValueSelect tooltip: full label on hover. + optionTooltip="singleLine" + optionTooltipClassName="opacity-65" onChange={(next) => { // Legacy keeps codes sorted and comma-joined. const value = [...next].sort().join(",");