summaryrefslogtreecommitdiffstats
path: root/app.rb
diff options
context:
space:
mode:
authorKen D'Ambrosio <ken@jots.org>2026-06-09 14:09:19 +0000
committerKen D'Ambrosio <ken@jots.org>2026-06-09 14:09:19 +0000
commita942b4e83d8c3c71020fdc6ae93954ddfa2ea338 (patch)
tree63deaef83c0cab7d4c51b2f95fc03966d21f8e49 /app.rb
parentc13a40a970be156a231200c20362636b198d32ec (diff)
Fix New Person flow: redirect to new cluster, show hero face, detect duplicate names
After moving a face to "New Person", the user is now taken directly to that cluster's detail page. If it's a single unnamed cluster, the face is shown prominently at the top. Typing an existing name on the name form triggers a confirm dialog: OK merges into the existing person's cluster, Cancel saves as a new separate person with the same name. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'app.rb')
-rw-r--r--app.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/app.rb b/app.rb
index 7ee7851..9e9cb9d 100644
--- a/app.rb
+++ b/app.rb
@@ -927,6 +927,11 @@ get '/admin/people/:uuid' do
.map { |k, v| { uuid: k, name: v['name'] || "(unnamed ยท #{(v['members'] || []).length})" } }
.sort_by { |x| x[:name].downcase }
+ @existing_names_json = regular
+ .select { |_, v| v['name'] }
+ .map { |k, v| { uuid: k, name: v['name'] } }
+ .to_json
+
erb :'admin/person_detail'
end
@@ -965,7 +970,13 @@ post '/admin/people/:uuid/move' do
data['people'] = people
atomic_write(PEOPLE_PATH, JSON.pretty_generate(data))
- people[src] ? redirect("/admin/people/#{src}") : redirect('/admin/people')
+ if to == 'new'
+ redirect "/admin/people/#{new_uid}"
+ elsif people[src]
+ redirect "/admin/people/#{src}"
+ else
+ redirect '/admin/people'
+ end
end
post '/admin/people/__pool__/blacklist_all' do