From 1692bf7d49c5ad8871386771ba8a4fe95fe23ca7 Mon Sep 17 00:00:00 2001
From: Colin Fletcher <colin.m.fletcher@googlemail.com>
Date: Sun, 10 May 2026 22:38:26 +0100
Subject: [PATCH 02/10] name 'New Playlist (for group)' after group or track

Default the playlist name chosen by 'New Playlist (for group)' to be the
group name, if any, or the track name otherwise, followed by an
incrementing number.

Fixes #10327
---
 gtk2_ardour/editor.cc | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index e7e11e294a..16bdf0c95f 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -3681,9 +3681,10 @@ Editor::stamp_new_playlist (string title, string &name, string &pgroup, bool cop
 
 	if (name.length() == 0) {
 		name = _("Take.1");
-		if (_session->playlists()->by_name (name)) {
-			name = Playlist::bump_name (name, *_session);
-		}
+	}
+
+	if (_session->playlists()->by_name (name)) {
+		name = Playlist::bump_name (name, *_session);
 	}
 
 	Prompter prompter (true);
@@ -3760,7 +3761,13 @@ void
 Editor::new_playlists_for_grouped_tracks (RouteUI* rui, bool copy)
 {
 	string name, gid;
-	if (stamp_new_playlist( copy ?  _("Copy Playlist for this track/group") : _("New Playlist for this track/group"), name, gid, copy)) {
+	std::shared_ptr<RouteGroup> rg = rui->route_group();
+	if (rg && rg->is_active () && rg->is_select ())
+		name = rg->name() + ".1";
+	else
+		name = rui->track()->playlist()->name();
+
+	if (stamp_new_playlist( copy ? _("Copy Playlist for this track/group") : _("New Playlist for this track/group"), name, gid, copy)) {
 		vector<std::shared_ptr<ARDOUR::Playlist> > playlists;
 		_session->playlists()->get (playlists);
 		mapover_grouped_routes (sigc::bind (sigc::mem_fun (*this, &Editor::mapped_use_new_playlist), name, gid, copy, playlists), rui, ARDOUR::Properties::group_select.property_id);
-- 
2.47.3

