feat: folder mapping UI on account add (probe + map modal)
ADD now probes both connections, lists folders on each side, and opens a
mapping modal to route source->destination folders (e.g. Спам -> Spam) so we
append into the existing folder instead of creating a duplicate.
- store: SetTaskFolderMapping (+ round-trip test)
- httpapi: POST /tasks/{id}/probe (test both, return folder lists),
PUT /tasks/{id}/folder-mapping
- web: FolderMappingModal (reuses Modal, size=lg), submitAccount probes then
opens the modal; confirm creates the account and saves the task mapping
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MMHQTtnQtQqL8muAXHr9kd
This commit is contained in:
@@ -57,6 +57,14 @@ func (s *Store) ListTasks(ctx context.Context) ([]Task, error) {
|
||||
return out, rows.Err()
|
||||
}
|
||||
|
||||
func (s *Store) SetTaskFolderMapping(ctx context.Context, id int64, mapping map[string]string) error {
|
||||
if mapping == nil {
|
||||
mapping = map[string]string{}
|
||||
}
|
||||
_, err := s.Pool.Exec(ctx, `UPDATE tasks SET folder_mapping=$2 WHERE id=$1`, id, mapping)
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *Store) SetTaskStatus(ctx context.Context, id int64, status string) error {
|
||||
_, err := s.Pool.Exec(ctx, `UPDATE tasks SET status=$2 WHERE id=$1`, id, status)
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user