chore(v029): final review minor cleanup — statusLabelWithParticle + initialTarget drop
- 한국어 조사 분기: '보관로/휴지통로/활성로' → '보관으로/휴지통으로/활성으로'
('완료로' 만 받침 X). 받침 jongseong 검사 helper.
- MoveStatusModal 의 unused initialTarget prop 제거 + caller (NoteCard) 정리
548/548 + typecheck 0 유지.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "inkling",
|
||||
"version": "0.2.7",
|
||||
"version": "0.2.8",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "inkling",
|
||||
"version": "0.2.7",
|
||||
"version": "0.2.8",
|
||||
"dependencies": {
|
||||
"better-sqlite3": "12.9.0",
|
||||
"electron-log": "5.2.0",
|
||||
|
||||
@@ -6,7 +6,6 @@ interface Props {
|
||||
noteId: string;
|
||||
rawText: string;
|
||||
summary: string;
|
||||
initialTarget: NoteStatus;
|
||||
onClose: () => void;
|
||||
onMoved: (status: NoteStatus, reason: string | null) => void;
|
||||
}
|
||||
@@ -14,13 +13,10 @@ interface Props {
|
||||
/**
|
||||
* v0.2.9 Cut B Task 7 — 메모 이동 Modal.
|
||||
*
|
||||
* 사유 입력 + 4 status 버튼 (활성/완료/보관/휴지통) + AI 자동 분류 placeholder.
|
||||
* AI 분류는 Task 9 에서 정식 구현 — 본 task 는 stub IPC (`ai:classify-status`)
|
||||
* 호출 path 만 working state. 추천 결과는 화면 표시 + 확정 버튼 두 단계.
|
||||
* 사유 입력 + 3 status 버튼 (완료/보관/휴지통) + AI 자동 분류.
|
||||
*/
|
||||
export function MoveStatusModal({
|
||||
noteId,
|
||||
initialTarget: _initialTarget,
|
||||
onClose,
|
||||
onMoved
|
||||
}: Props): React.ReactElement {
|
||||
@@ -139,3 +135,16 @@ export function statusLabel(s: NoteStatus): string {
|
||||
return '휴지통';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* status 의 한글 라벨에 적절한 조사를 붙여 반환. 받침 있으면 "으로", 없으면 "로".
|
||||
* 예: '완료로' / '보관으로' / '휴지통으로' / '활성으로'.
|
||||
*/
|
||||
export function statusLabelWithParticle(s: NoteStatus): string {
|
||||
const label = statusLabel(s);
|
||||
const last = label.charCodeAt(label.length - 1);
|
||||
// 한글 syllable block 외 → "로" default
|
||||
if (last < 0xAC00 || last > 0xD7A3) return `${label}로`;
|
||||
const jongseong = (last - 0xAC00) % 28;
|
||||
return jongseong === 0 ? `${label}로` : `${label}으로`;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useInbox } from '../store.js';
|
||||
import { EditableField } from './EditableField.js';
|
||||
import { IntentBanner } from './IntentBanner.js';
|
||||
import { pushTagUndo } from './TagUndoToast.js';
|
||||
import { MoveStatusModal, statusLabel } from './MoveStatusModal.js';
|
||||
import { MoveStatusModal, statusLabelWithParticle } from './MoveStatusModal.js';
|
||||
|
||||
interface Props {
|
||||
note: Note;
|
||||
@@ -438,7 +438,7 @@ export function NoteCard({ note, onDeleted, onUpdated, mode = 'inbox', onRestore
|
||||
cursor: 'pointer'
|
||||
}}
|
||||
>
|
||||
{statusLabel(t)}로 이동
|
||||
{statusLabelWithParticle(t)} 이동
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
@@ -476,7 +476,6 @@ export function NoteCard({ note, onDeleted, onUpdated, mode = 'inbox', onRestore
|
||||
noteId={local.id}
|
||||
rawText={local.rawText}
|
||||
summary={local.aiSummary ?? ''}
|
||||
initialTarget={moveTarget}
|
||||
onClose={() => setMoveTarget(null)}
|
||||
onMoved={(newStatus, reason) => {
|
||||
const updated = { ...local, status: newStatus, moveReason: reason };
|
||||
|
||||
@@ -32,7 +32,6 @@ describe('MoveStatusModal', () => {
|
||||
noteId="n1"
|
||||
rawText="t"
|
||||
summary=""
|
||||
initialTarget="completed"
|
||||
onClose={vi.fn()}
|
||||
onMoved={vi.fn()}
|
||||
/>
|
||||
@@ -51,7 +50,6 @@ describe('MoveStatusModal', () => {
|
||||
noteId="n1"
|
||||
rawText="t"
|
||||
summary=""
|
||||
initialTarget="completed"
|
||||
onClose={vi.fn()}
|
||||
onMoved={onMoved}
|
||||
/>
|
||||
@@ -71,7 +69,6 @@ describe('MoveStatusModal', () => {
|
||||
noteId="n1"
|
||||
rawText="t"
|
||||
summary=""
|
||||
initialTarget="completed"
|
||||
onClose={vi.fn()}
|
||||
onMoved={onMoved}
|
||||
/>
|
||||
@@ -91,7 +88,6 @@ describe('MoveStatusModal', () => {
|
||||
noteId="n1"
|
||||
rawText="t"
|
||||
summary=""
|
||||
initialTarget="archived"
|
||||
onClose={vi.fn()}
|
||||
onMoved={onMoved}
|
||||
/>
|
||||
|
||||
@@ -134,9 +134,9 @@ describe('NoteCard — 이동 메뉴 (v0.2.9 Cut B Task 6)', () => {
|
||||
render(<NoteCard note={baseNote} onUpdated={() => {}} mode="inbox" />);
|
||||
fireEvent.click(screen.getByRole('button', { name: '이동' }));
|
||||
expect(screen.getByRole('button', { name: '완료로 이동' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '보관로 이동' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '휴지통로 이동' })).toBeInTheDocument();
|
||||
expect(screen.queryByRole('button', { name: '활성로 이동' })).toBeNull();
|
||||
expect(screen.getByRole('button', { name: '보관으로 이동' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '휴지통으로 이동' })).toBeInTheDocument();
|
||||
expect(screen.queryByRole('button', { name: '활성으로 이동' })).toBeNull();
|
||||
});
|
||||
|
||||
it('메뉴 항목 클릭 → MoveStatusModal 열림 + 확정 시 setStatus 호출', async () => {
|
||||
|
||||
Reference in New Issue
Block a user