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.

Keep the meeting panel with its ticket and the selection on the list

Guido Boyke49f61dec3d43
diff --git a/app/assets/stylesheets/layout.css b/app/assets/stylesheets/layout.css
index 5883de6..0fdc57c 100644
--- a/app/assets/stylesheets/layout.css
+++ b/app/assets/stylesheets/layout.css
@@ -14,6 +14,8 @@
* History: was called labor.css until 06/2026 (inventory: doc/frontend_inventur_phase1_css.md). */
:root {
--panel-raw: 300px; --panel-width: var(--panel-raw);
+ /* The channel between two tracks of a .layout grid. */
+ --lane-gap: 24px;
/* Page widths, named once (section "Page widths" below). A view names the
class, never a number: spec/architecture/page_width_guard_spec.rb. */
@@ -102,7 +104,7 @@
.layout {
display: grid;
grid-template-rows: minmax(0, 1fr);
- column-gap: 24px;
+ column-gap: var(--lane-gap);
transition: --panel-width 0.4s ease;
}
@@ -1507,6 +1509,13 @@ main:has(.layout) > div {
.layout.two-column:not(.hide-content):not(.hide-panel) .lane-split {
display: none;
}
+ /* Three tracks with the list's at 0px still have two channels, and the first
+ one stands before the ticket: 24px of page ground on top of the page's own
+ inset (the two-track variants above set column-gap: 0 for the same reason).
+ The ticket takes that channel back; the one between ticket and meeting stays. */
+ .layout.two-column:not(.hide-content):not(.hide-panel) > .column.content {
+ margin-left: calc(-1 * var(--lane-gap));
+ }
}
/* Two-column responsive overrides */
diff --git a/app/controllers/organisations/ticket_meeting_panels_controller.rb b/app/controllers/organisations/ticket_meeting_panels_controller.rb
index c5f4499..6a2be34 100644
--- a/app/controllers/organisations/ticket_meeting_panels_controller.rb
+++ b/app/controllers/organisations/ticket_meeting_panels_controller.rb
@@ -40,7 +40,8 @@ module Organisations
requested = params[:meeting_id]
return @meetings.first if requested.blank?
- @meetings.find { |meeting| meeting.id == requested.to_s }
+ # Postgres accepts a UUID in either case and answers in lower case.
+ @meetings.find { |meeting| meeting.id == requested.to_s.downcase }
end
def panel_request?
diff --git a/app/javascript/controllers/layout_toggle_controller.js b/app/javascript/controllers/layout_toggle_controller.js
index 8d77649..2c0ec64 100644
--- a/app/javascript/controllers/layout_toggle_controller.js
+++ b/app/javascript/controllers/layout_toggle_controller.js
@@ -100,7 +100,7 @@ export default class extends Controller {
this.panelFromFrame()
// A grid without a panel column can never show one, whatever the shared
- // storage key says (it may carry panel:true from Knowledge). The clamp lives
+ // storage key says (it may carry panel:true from an older visit). The clamp lives
// in updateLayout(), the ONE place that flips hide-panel, so every reader of
// the stored state (connect, handleFrameLoad, togglePanel) is covered, and the
// stored value itself is left alone: a tickets visit must not close the lane
@@ -410,9 +410,10 @@ export default class extends Controller {
this.updateLayout()
}
- // True when the grid renders a third lane. The current ticket, knowledge and
- // meetings grids render none; NeoTwoColumnGridComponent only emits the aside
- // for a filled slot.
+ // True when the grid renders a third lane. Only the ticket page's grids (table
+ // and board) render one, for the meeting beside the ticket; knowledge and
+ // meetings render none. NeoTwoColumnGridComponent emits the aside only for a
+ // filled slot.
hasPanelColumn() {
const layout = this.hasLayoutTarget ? this.layoutTarget : document.querySelector('.layout')
return Boolean(layout && layout.querySelector('.column.panel'))
@@ -447,8 +448,14 @@ export default class extends Controller {
if (!this.layoutState.panel) this.togglePanel()
}
+ // Closed or not, the frame is emptied: an answer that arrived for a ticket the
+ // lane has already left must not wait in a hidden lane.
closePanel() {
- if (this.layoutState.panel) this.togglePanel()
+ if (this.layoutState.panel) {
+ this.togglePanel()
+ } else {
+ this.emptyPanelFrame()
+ }
}
// A panel whose frame holds its state is open exactly while the frame holds
@@ -462,13 +469,19 @@ export default class extends Controller {
// Emptied, not only hidden: the next open is a fresh request, and a closed
// panel holds no meeting the assistant could still find on the page (S3).
+ // REPLACED by a new empty frame of the same id, not cleared: removing src does
+ // not cancel a request that is still running, and its answer would fill the
+ // frame again and reopen the panel the user has just closed. The answer now
+ // lands in the old element, which is no longer in the page. Links find the
+ // frame by its id when they are clicked, so they reach the new one.
emptyPanelFrame() {
if (!this.panelFrameIdValue) return
const frame = document.getElementById(this.panelFrameIdValue)
if (!frame) return
- frame.removeAttribute("src")
- frame.replaceChildren()
+ const empty = document.createElement("turbo-frame")
+ empty.id = frame.id
+ frame.replaceWith(empty)
}
// The lane's object is gone: close as the ✕ does, and take its names out of
diff --git a/app/javascript/controllers/ticket_meeting_panel_controller.js b/app/javascript/controllers/ticket_meeting_panel_controller.js
index 28002a4..0a4a212 100644
--- a/app/javascript/controllers/ticket_meeting_panel_controller.js
+++ b/app/javascript/controllers/ticket_meeting_panel_controller.js
@@ -7,7 +7,9 @@ import { escapeOwned } from "escape_owner"
// when to open and when to close, as events on its mount:
// * connect opens it: the frame has just been filled. Not turbo:frame-load: on the
// ticket page that event does not reliably reach the document (ticket_selection,
-// controllers/CLAUDE.md), and a connect happens for every way content arrives;
+// controllers/CLAUDE.md), and a connect happens for every way content arrives.
+// Unless the lane has moved on to another ticket while the answer was on its way:
+// then it closes at once;
// * Escape closes it, before the ticket lane behind it (lib/escape_owner.js);
// * the ticket lane showing another ticket, or none, closes it (decision F3): the
// meeting belongs to the ticket it was opened from. The lane has eight writers and
@@ -16,7 +18,8 @@ export default class extends Controller {
static values = { ticketId: String }
connect() {
- this.dispatch("open")
+ this.grid = this.element.closest(".layout")
+ this.dispatch(this.laneShowsTicket() ? "open" : "close")
this.boundNoteEscape = this.noteEscape.bind(this)
window.addEventListener("keydown", this.boundNoteEscape, true)
@@ -69,12 +72,40 @@ export default class extends Controller {
return escapeOwned(others, document)
}
+ // A linked ticket of the same project opens in the lane the way its row does, by
+ // clicking that row: list_row writes the address, loads the lane and marks the row,
+ // and nothing else ends up marked. Off the current page of the list, the ticket
+ // page itself (the link's address). A modified click is the browser's (new tab).
+ openTicket(event) {
+ if (event.button > 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return
+
+ const id = event.currentTarget.dataset.ticketId
+ const row = this.grid?.querySelector(`.column.list [data-controller~="list-row"][data-list-row-id-value="${CSS.escape(id)}"]`)
+ event.preventDefault()
+ if (row) {
+ row.click()
+ } else {
+ window.Turbo.visit(event.currentTarget.href)
+ }
+ }
+
+ get lane() {
+ return document.getElementById("ticket_display_frame")
+ }
+
+ laneShowsTicket() {
+ const lane = this.lane
+ if (!lane || !this.ticketIdValue) return true
+
+ return Boolean(lane.querySelector(`#ticket-content-${CSS.escape(this.ticketIdValue)}`))
+ }
+
observeTicketLane() {
- const lane = document.getElementById("ticket_display_frame")
+ const lane = this.lane
if (!lane || !this.ticketIdValue) return
this.laneObserver = new MutationObserver(() => {
- if (!lane.querySelector(`#ticket-content-${CSS.escape(this.ticketIdValue)}`)) this.close()
+ if (!this.laneShowsTicket()) this.close()
})
this.laneObserver.observe(lane, { childList: true })
}
diff --git a/app/views/organisations/meetings/_meeting_reading.html.erb b/app/views/organisations/meetings/_meeting_reading.html.erb
index a265f7b..51a331e 100644
--- a/app/views/organisations/meetings/_meeting_reading.html.erb
+++ b/app/views/organisations/meetings/_meeting_reading.html.erb
@@ -1,11 +1,12 @@
-<%# locals: (meeting:, participants:, can_write: false, lane_state: {}, current_frame_id: nil, panel: false) %>
+<%# locals: (meeting:, participants:, can_write: false, lane_state: {}, current_frame_id: nil, panel: false, summary_refresh: nil) %>
<%# What a meeting says: the AI summary, the notes and the transcript. The meeting's page
and the read-only panel beside a ticket (panel: true) render this one block, so the two
- cannot drift. In the panel nothing is writable (can_write is false there), the summary
- offers no refresh into a frame the ticket page does not have, and the transcript is
- always collapsed: the panel is a look beside the ticket, not the reading place. %>
+ cannot drift. In the panel nothing is writable (can_write is false there), the
+ summary's refresh reloads the panel (summary_refresh: url and frame; the meetings lane
+ it reloads by default is not on the ticket page), and the transcript is always
+ collapsed: the panel is a look beside the ticket, not the reading place. %>
<div class="width-text">
- <%= render 'organisations/meetings/summary_section', meeting: meeting, can_write: can_write, lane_state: lane_state, refreshable: !panel %>
+ <%= render 'organisations/meetings/summary_section', meeting: meeting, can_write: can_write, lane_state: lane_state, refresh: summary_refresh %>
<% if meeting.notes.blank? && meeting.transcript.blank? %>
<div class="text-sm text-cream-600 italic py-2">
diff --git a/app/views/organisations/meetings/_summary_section.html.erb b/app/views/organisations/meetings/_summary_section.html.erb
index 88ad8c6..537949c 100644
--- a/app/views/organisations/meetings/_summary_section.html.erb
+++ b/app/views/organisations/meetings/_summary_section.html.erb
@@ -16,8 +16,12 @@
ai_available → active. %>
<% can_write = local_assigns.fetch(:can_write, true) %>
<% lane_state = local_assigns.fetch(:lane_state, {}).symbolize_keys %>
-<% refreshable = local_assigns.fetch(:refreshable, true) %>
<% org = meeting.organisation %>
+<%# Where "refresh" reloads: the meetings lane by default; the panel beside a ticket
+ passes its own address and frame (meetings/_meeting_reading). %>
+<% refresh = local_assigns[:refresh] ||
+ { url: organisation_project_meeting_path(org, meeting.project, meeting, frame: 'content', **lane_state),
+ frame: 'meeting_display_frame' } %>
<% ai_enabled = org&.ai_enabled? %>
<%# R2: asks the FEATURE this section offers — :meeting_summary, whose seam is
Meetings::SummaryService. Same key as MeetingsController#create_summary, so
@@ -72,14 +76,12 @@
<%= t('views.organisations.meetings.show.summary_in_progress') %>
<%# Fallback for when the live broadcast is not delivered: reload the
detail frame in request context (correct permissions + latest state).
- Not in the panel beside a ticket (refreshable: false): that page has no
- meeting_display_frame to reload. %>
- <% if refreshable %>
- <%= link_to t('views.organisations.meetings.show.summary_refresh'),
- organisation_project_meeting_path(org, meeting.project, meeting, frame: 'content', **lane_state),
- data: { turbo_frame: 'meeting_display_frame' },
- class: 'not-italic underline hover:text-ink' %>
- <% end %>
+ The panel beside a ticket subscribes to no broadcast, so this is its
+ only way to the finished summary. %>
+ <%= link_to t('views.organisations.meetings.show.summary_refresh'),
+ refresh[:url],
+ data: { turbo_frame: refresh[:frame] },
+ class: 'not-italic underline hover:text-ink' %>
</p>
<% elsif summary.present? %>
<%# The LLM answers in Markdown ("**Kopf:**", "- Punkt"), so this goes through the
diff --git a/app/views/organisations/tickets/_meeting_panel.html.erb b/app/views/organisations/tickets/_meeting_panel.html.erb
index c2f7ca4..286833f 100644
--- a/app/views/organisations/tickets/_meeting_panel.html.erb
+++ b/app/views/organisations/tickets/_meeting_panel.html.erb
@@ -40,7 +40,10 @@
<div class="border-b border-cream-300 mt-4 mb-5"></div>
- <%= render 'organisations/meetings/meeting_reading', meeting: meeting, participants: participants, panel: true %>
+ <%= render 'organisations/meetings/meeting_reading',
+ meeting: meeting, participants: participants, panel: true,
+ summary_refresh: { url: organisation_project_ticket_meeting_panel_path(current_organisation, ticket.project, ticket, meeting_id: meeting.id),
+ frame: Organisations::TicketMeetingPanelsController::FRAME_ID } %>
<% if linked_tickets.any? %>
<section class="mt-8">
@@ -55,23 +58,18 @@
<span class="min-w-0 flex-1 truncate text-cream-900"><%= other.title %></span>
<span class="shrink-0 text-xs italic text-cream-500"><%= t("#{mp}.this_ticket") %></span>
<% elsif other.project_id == ticket.project_id %>
- <%# Opens in the lane the way a row does (list_row: the page address, the lane's
- frame, the selection mark); the href is the page address for a new tab.
- The lane then shows another ticket, and this panel closes (F3). %>
- <a href="<%= organisation_project_tickets_path(current_organisation, other.project, ticket_id: other.id) %>"
- class="min-w-0 flex-1 truncate text-cream-900 hover:underline"
- data-controller="list-row"
- data-list-row-url-value="<%= organisation_project_ticket_path(current_organisation, other.project, other) %>"
- data-list-row-id-value="<%= other.id %>"
- data-list-row-param-value="ticket_id"
- data-list-row-frame-value="ticket_display_frame"
- data-action="click->list-row#click"><%= other.title %></a>
- <% else %>
- <%# Another project, another page: no lane of this one can show it. %>
+ <%# Opens in the lane by clicking its row (ticket_meeting_panel#openTicket), so
+ the row is what gets marked; the href is the ticket page for a new tab and
+ for a ticket off the list's current page. The lane then shows another
+ ticket, and this panel closes (F3). %>
<%= link_to other.title,
organisation_project_tickets_path(current_organisation, other.project, ticket_id: other.id),
class: 'min-w-0 flex-1 truncate text-cream-900 hover:underline',
- data: { turbo_frame: '_top' } %>
+ data: { ticket_id: other.id, action: 'ticket-meeting-panel#openTicket' } %>
+ <% else %>
+ <%# Another project, another page: no lane of this one can show it. The
+ relations' link already decides that (TicketRelationsHelper). %>
+ <%= ticket_relation_link(other, from: ticket, class: 'min-w-0 flex-1 truncate text-cream-900 hover:underline') do %><%= other.title %><% end %>
<span class="shrink-0 truncate text-xs text-cream-500"><%= other.project.name %></span>
<% end %>
</li>
diff --git a/spec/requests/organisations/ticket_meeting_panel_spec.rb b/spec/requests/organisations/ticket_meeting_panel_spec.rb
index d4984e6..31112c5 100644
--- a/spec/requests/organisations/ticket_meeting_panel_spec.rb
+++ b/spec/requests/organisations/ticket_meeting_panel_spec.rb
@@ -112,6 +112,27 @@ RSpec.describe 'Ticket meeting panel', :ci_guard, type: :request do
expect(transcript).not_to be_nil
end
+ it 'accepts the meeting id in capitals, as the database does' do
+ sign_in reader
+ panel(meeting_id: meeting.id.upcase)
+
+ expect(response).to have_http_status(:ok)
+ expect(response.body).to include('Kickoff-Panel-QX')
+ end
+
+ it 'refreshes a summary still being written into the panel, not into the meetings lane' do
+ ActsAsTenant.with_tenant(organisation) { meeting.update!(summary_creation_flag: true) }
+ sign_in reader
+ panel
+
+ refresh = Nokogiri::HTML(response.body)
+ .at_css(%(a[href="#{organisation_project_ticket_meeting_panel_path(organisation, project, ticket, meeting_id: meeting.id)}"]))
+ expect(refresh).not_to be_nil
+ expect(refresh.text).to include(I18n.t('views.organisations.meetings.show.summary_refresh'))
+ expect(refresh['data-turbo-frame']).to eq('ticket_meeting_panel')
+ expect(response.body).not_to include('meeting_display_frame')
+ end
+
it 'offers the meeting page and leaves the frame for it' do
sign_in reader
panel
@@ -186,9 +207,9 @@ RSpec.describe 'Ticket meeting panel', :ci_guard, type: :request do
panel
document = Nokogiri::HTML(response.body)
- sibling_link = document.at_css(%(a[data-list-row-id-value="#{sibling.id}"]))
- expect(sibling_link['data-controller']).to eq('list-row')
- expect(sibling_link['data-list-row-frame-value']).to eq('ticket_display_frame')
+ sibling_link = document.at_css(%(a[data-ticket-id="#{sibling.id}"]))
+ expect(sibling_link['data-action']).to eq('ticket-meeting-panel#openTicket')
+ expect(sibling_link['data-turbo-frame']).to be_nil
expect(sibling_link['href']).to eq(organisation_project_tickets_path(organisation, project, ticket_id: sibling.id))
expect(document.css('a').map(&:text)).not_to include('Ticket-With-Meetings')
expect(document.text).to include('Ticket-With-Meetings')
diff --git a/spec/system/ticket_meeting_panel_spec.rb b/spec/system/ticket_meeting_panel_spec.rb
index 5a81df8..24073ef 100644
--- a/spec/system/ticket_meeting_panel_spec.rb
+++ b/spec/system/ticket_meeting_panel_spec.rb
@@ -113,6 +113,52 @@ RSpec.describe 'Meeting beside the ticket', type: :system do
expect(page).to have_current_path(lane_path(sibling))
end
+ it 'starts the ticket at the edge of the grid while the list has yielded' do
+ visit lane_path
+ open_panel
+ sleep 0.5 # the grid's transition
+
+ grid_left = page.evaluate_script("document.querySelector('.layout').getBoundingClientRect().left")
+ ticket_left = page.evaluate_script("document.querySelector('.layout .column.content').getBoundingClientRect().left")
+ expect(ticket_left).to be_within(1).of(grid_left)
+ end
+
+ it 'marks the row of a ticket opened from the panel, not the link' do
+ visit lane_path
+ open_panel
+
+ within('aside.column.panel') { click_link 'Sibling from the meeting' }
+
+ expect(page).to have_css("#ticket-content-#{sibling.id}")
+ expect(page).to have_css(%([data-list-row-id-value="#{sibling.id}"].selected-row), visible: :all)
+ expect(page).to have_no_css(%([data-list-row-id-value="#{ticket.id}"].selected-row), visible: :all)
+ end
+
+ it 'does not open a meeting that arrives after its ticket has left the lane' do
+ visit lane_path
+ find(%([data-list-row-id-value="#{sibling.id}"])).click
+ expect(page).to have_css("#ticket-content-#{sibling.id}")
+
+ url = organisation_project_ticket_meeting_panel_path(organisation, project, ticket, meeting_id: meeting.id)
+ page.execute_script("document.getElementById('ticket_meeting_panel').src = #{url.to_json}")
+ sleep 1
+
+ expect_panel_closed
+ expect(page).to have_css("#ticket-content-#{sibling.id}")
+ end
+
+ it 'stays closed when the answer to a request still running arrives after the close' do
+ visit lane_path
+ open_panel
+
+ url = organisation_project_ticket_meeting_panel_path(organisation, project, ticket, meeting_id: meeting.id)
+ page.execute_script("document.getElementById('ticket_meeting_panel').src = #{"#{url}&again=1".to_json};" \
+ "document.querySelector('aside.column.panel .panel-close').click()")
+ sleep 1
+
+ expect_panel_closed
+ end
+
it 'closes the panel when the lane closes' do
visit lane_path
open_panel