Skip to content

Self-hosted project management for devs and their clients: tickets, time tracking, docs and meetings, with an AI assistant that cites its sources. AGPL-3.0.

Open a sub-task from its list in the detail frame

Guido Boyke83649b829be4
diff --git a/app/views/organisations/tickets/_subtask_row.html.erb b/app/views/organisations/tickets/_subtask_row.html.erb
index 98ede51..85becf9 100644
--- a/app/views/organisations/tickets/_subtask_row.html.erb
+++ b/app/views/organisations/tickets/_subtask_row.html.erb
@@ -1,10 +1,14 @@
<%# One sub-task row. Shared by the section's list AND the quick-add Turbo Stream (append) so the
- appended row is byte-identical to a page-rendered one. Locals: child, project, org, status_def. %>
+ appended row is byte-identical to a page-rendered one. Locals: child, project, org, status_def.
+ The link names the detail frame: the section sits inside the timeline's frame, and without a
+ target it stays there, where the answer holds no such frame ("Content missing"). Where no
+ detail frame exists (the inbox pane), Turbo makes it a normal visit. %>
<li class="flex items-center gap-3 px-3 py-2">
<span class="font-mono text-xs text-cream-500 tabular-nums">#<%= child.number %></span>
<%= link_to child.title,
organisation_project_tickets_path(org, project, ticket_id: child.id),
- class: "flex-1 truncate text-sm text-cream-900 hover:underline" %>
+ class: "flex-1 truncate text-sm text-cream-900 hover:underline",
+ data: { turbo_frame: 'ticket_display_frame' } %>
<% status_value = child.get_custom_attribute('status') %>
<% if status_value.present? %>
<span class="h-6 shrink-0 rounded-full border border-cream-300 px-2 text-xs leading-6 text-cream-700">
diff --git a/spec/requests/organisations/tickets_subtasks_render_spec.rb b/spec/requests/organisations/tickets_subtasks_render_spec.rb
index 4546ab4..3bc012f 100644
--- a/spec/requests/organisations/tickets_subtasks_render_spec.rb
+++ b/spec/requests/organisations/tickets_subtasks_render_spec.rb
@@ -57,6 +57,19 @@ RSpec.describe 'Tickets sub-tasks (detail rendering)', type: :request do
expect(body).to include(done_child.title)
end
+ # The section sits inside the turbo frame of the timeline. A link without a target stays in
+ # that frame, the answer holds no such frame, and the reader gets "Content missing".
+ it 'opens a sub-task from the list in the detail frame, not in the timeline frame' do
+ parent = create(:ticket, project: project, creator: user)
+ child = create(:ticket, project: project, creator: user, parent: parent)
+
+ link = Nokogiri::HTML(subtasks_body(parent)).at_css("a[href*='ticket_id=#{child.id}']")
+
+ expect(response).to have_http_status(:ok)
+ expect(link).to be_present
+ expect(link['data-turbo-frame']).to eq('ticket_display_frame')
+ end
+
it 'shows only the compact right-aligned quick-add when there are no sub-tasks (no heading/hint/hero)' do
lone = create(:ticket, project: project, creator: user)