a↗agentbay.AgentBay を入手
マイアカウント ▾
メニュー
← 実践ガイドへ戻る
実践ガイドの出力

インポートの流れ

元のファイルをダウンロード ↓

CRM-142の範囲を限定した設計

貼り付けた架空チケットの設計案です。保存先: tickets/CRM-142.md。Jiraの取得・更新、関係者への聞き取り、設計承認は行っていません。作者は元に戻せる選択を委任し、計画のみを依頼しました。

既存の流れと意図

index.html は、Contacts、Search contacts、連絡先一覧、展開できるAdd contactを表示します。 src/app.js は、連絡先を一度読み、searchContactsで検索し、テキストノードとして描画し、saveContactsを待ってからメモリ内の行を置き換えます。この流れを残しながら、繰り返す手入力をローカルのCSVレビューに置き換えられるよう、カスタマーサクセス利用者を支援します。

方法

方法利点費用・負担
Contacts上のインラインインポートパネル現在のページ、状態表示、一覧を再利用し、ルートやダイアログを追加しません長いプレビューで一覧が下に押される
同じページ内の別レビュービューレビューに使える広い領域ビューの状態、隠した一覧、戻る操作とフォーカスの管理が増えます

作者の選択:検索欄の上にインラインパネルを置き、空でない各レコードをカードで示します。この小さな既存CRMには、より単純な方法です。モーダル、ページ分割、セル編集、項目マッピングは追加しません。不正なデータは元のファイルで修正し、再選択します。

流れ

既存の一覧 → Import contacts → ラベル付きCSVファイル選択 → Review CSV → 件数と全レコード → Import ready contacts → 保存成功 → パネルを閉じ、検索を解除し、追加・スキップ件数とともに既存の一覧を表示。レビュー中も検索とAdd contactは利用でき、確認時に現在の連絡先を再確認します。保存中はデータを変更する操作を無効にします。

Cancel importまたはBack to contactsは、保存せずにファイル、エラー、プレビューを破棄し、Import contactsへフォーカスを戻します。不正・容量超過のファイルには役立つエラーを示し、インポート可能なプレビューは表示しません。新しい選択で以前のプレビューとエラーを消します。保存失敗時はレビューを残して失敗を報告し、同じ確認操作で再試行できるようにします。成功を伝えるのはアダプターの処理が完了してからです。

境界と作者の判断

後で実装する対象は次のみ: index.html, style.css, src/app.js、新規の src/import.js。維持するもの: src/contacts.js, src/storage.js、テスト、サンプル、チケット、サーバー、パッケージ。依存関係、リモートアップロード、アカウント、データベース、ログイン、バックグラウンドジョブ、サイト刷新は追加しません。永続化には、既存の名前空間付きlocalStorageのみを使います。

適用するもの: docs/import-contract.md:UTF-8で100,000バイト、空でないデータ500レコード、正規化したヘッダー、純粋なプレビューとマージ。未知の重複しないヘッダー列は受け入れますが、値は無視します。ヘッダーの幅を超える行のフィールドは拒否します。末尾の不足セルは空文字として補い、フィールド検証を行います。空とは、解析した全セルが空白のみであることです。空レコードを除いて、論理データレコード番号を1,から表示し、引用符内の改行は新レコードに数えません。これらは作者の判断です。

計画に残る未決の製品判断はありません。実装前にオペレーターがこの選択を確認できます。参照: docs/screen-design.md, docs/architecture.md と docs/implementation-plan.md.

元のファイルと出所の詳細

output/docs/brainstorming.md.txt · SHA-256 5b32b6e1beddb07edce67d1c86ff9fbb2e94c0b106899177367b74e953331796

# CRM-142 bounded design

Design proposal for the pasted fictional ticket, also stored in `tickets/CRM-142.md`. No Jira fetch/update, stakeholder interview or design approval occurred. The author delegated reversible choices and requested planning only.

## Existing flow and intent
`index.html` presents Contacts, Search contacts, the contact list and expandable Add contact. `src/app.js` reads contacts once, filters through searchContacts, renders text nodes and awaits saveContacts before replacing its in-memory rows. Help customer-success users replace repeated manual entry with a local CSV review while retaining that flow.

## Approaches
| Approach | Benefit | Cost |
| --- | --- | --- |
| Inline import panel on Contacts | Reuses current page, status and list; no route or dialog | Long previews push the list down |
| Separate review view on the same page | More room for review | Extra view state, hidden list and return/focus handling |

Author choice: inline panel above search, with a card per nonblank record. It is the simpler fit for this small existing CRM. No modal, pagination, editable cells or field mapping. Correct invalid data in the source file and select it again.

## Flow
Existing list → Import contacts → labelled CSV file selection → Review CSV → counts and every record → Import ready contacts → successful save → close panel, clear search and show the existing list with added/skipped summary. Search and Add contact remain available during review; confirmation rechecks current contacts. Disable mutating controls during a save.

Cancel import or Back to contacts discards the file, errors and preview without saving; return focus to Import contacts. Malformed/oversized files show a useful error and no importable preview. A new selection clears previous preview/errors. A failed save keeps the review, reports failure, and enables the same confirmation for retry. Success is announced only after the adapter resolves.

## Boundaries and author calls
Implement later only in `index.html`, `style.css`, `src/app.js`, new `src/import.js`. Preserve `src/contacts.js`, `src/storage.js`, tests, samples, ticket, server and package. No dependencies, remote uploads, accounts, database, login, background jobs or site refresh. Existing namespaced localStorage is the only persistence.

Apply `docs/import-contract.md`: 100,000 UTF-8 bytes, 500 nonblank data records, normalized headers and pure preview/merge. Accept unknown distinct header columns but ignore their values; reject row fields beyond header width. Missing trailing cells become empty strings and undergo field validation. Blank means all parsed cells are whitespace-only. Display logical data record numbers starting at 1, ignoring blank records; quoted newlines do not create new records. These are author choices.

No unresolved product decision remains for planning; the operator can review these choices before any implementation. See `docs/screen-design.md`, `docs/architecture.md` and `docs/implementation-plan.md`.