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.
Ruby agplai-assistantdockerdsgvogdprhotwireissue-trackerjira-alternativeknowledge-basellmmcp-servermeeting-notesopen-sourceproject-managementredmine-alternativeruby-on-railsself-hostedticketingtime-tracking
Open a ticket's meeting beside it in a read-only panel
Guido Boyke997573ed7455
diff --git a/.github/workflows/guards.yml b/.github/workflows/guards.ymlindex 2967672..5445978 100644--- a/.github/workflows/guards.yml+++ b/.github/workflows/guards.yml@@ -327,6 +327,7 @@ jobs:spec/requests/organisations/rich_text_editor_forms_spec.rbspec/requests/organisations/ticket_assistant_seams_spec.rbspec/requests/organisations/ticket_meeting_references_access_spec.rb+ spec/requests/organisations/ticket_meeting_panel_spec.rbspec/requests/organisations/ticket_writing_surface_spec.rbspec/requests/organisations/mobile_navigation_spec.rbspec/requests/organisations/tickets_destroy_spec.rb@@ -637,6 +638,7 @@ jobs:spec/system/meeting_filters_columns_spec.rbspec/system/ticket_list_unread_dot_spec.rbspec/system/ticket_relations_spec.rb+ spec/system/ticket_meeting_panel_spec.rbspec/system/ticket_waiting_list_spec.rbspec/system/ticket_waiting_filters_spec.rbspec/services/smart_folder_query_builder_spec.rbdiff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.cssindex 6e7100c..e58fbad 100644--- a/app/assets/stylesheets/application.css+++ b/app/assets/stylesheets/application.css@@ -18,6 +18,7 @@*= require components/markdown_preview*= require components/filter_bar*= require components/column_picker+ *= require components/ticket_meeting_panel*= require components/sidebar_nav*= require components/mobile_app*/diff --git a/app/assets/stylesheets/components/ticket_meeting_panel.css b/app/assets/stylesheets/components/ticket_meeting_panel.cssnew file mode 100644index 0000000..5b93148--- /dev/null+++ b/app/assets/stylesheets/components/ticket_meeting_panel.css@@ -0,0 +1,71 @@+/* The meeting beside the ticket (doc/ticket_meeting_panel_plan.md).+ *+ * 1. The meetings section of a ticket (tickets/_meeting_references_section) renders+ * every entry in three forms, and the owner of turbo-frame#ticket_display_frame+ * names the one that applies in data-meeting-links: "panel" on the list and the+ * board (opens beside the ticket), "text" in the inbox pane (no link), "page" on+ * the phone (the meetings page). Eight writers re-render that frame, several of+ * them without knowing which page asked; the frame element survives all of them.+ * Without a name: page, the form that works on any page.+ * 2. The panel's head (tickets/_meeting_panel): the meetings of the ticket as tabs.+ * The lane's own surface and width live in layout.css, beside the other lanes.+ */++.meeting-reference--panel,+.meeting-reference--text {+ display: none;+}++[data-meeting-links="panel"] .meeting-reference--panel,+[data-meeting-links="text"] .meeting-reference--text {+ display: block;+}++[data-meeting-links="panel"] .meeting-reference--page,+[data-meeting-links="text"] .meeting-reference--page {+ display: none;+}++/* Room on the right for the lane's close button (NeoTwoColumnGridComponent),+ which sits absolutely in the top right corner of the lane. */+.ticket-meeting-panel__head {+ padding-right: 2rem;+}++.ticket-meeting-panel__tabs {+ display: flex;+ flex-wrap: wrap;+ gap: 0.375rem;+ margin-top: 0.5rem;+}++.ticket-meeting-panel__tab {+ display: inline-flex;+ align-items: center;+ gap: 0.375rem;+ max-width: 100%;+ padding: 0.125rem 0.625rem;+ border: 1px solid rgb(var(--cream-300));+ border-radius: 999px;+ font-size: 0.75rem;+ line-height: 1.25rem;+ color: rgb(var(--cream-700));+}++.ticket-meeting-panel__tab:hover {+ border-color: rgb(var(--cream-500));+ color: rgb(var(--cream-900));+}++.ticket-meeting-panel__tab[aria-current="true"] {+ border-color: rgb(var(--ink));+ background: rgb(var(--cream-100));+ color: rgb(var(--cream-900));+ font-weight: 600;+}++.ticket-meeting-panel__empty {+ font-size: 0.875rem;+ font-style: italic;+ color: rgb(var(--cream-600));+}diff --git a/app/assets/stylesheets/layout.css b/app/assets/stylesheets/layout.cssindex 13baf2c..5883de6 100644--- a/app/assets/stylesheets/layout.css+++ b/app/assets/stylesheets/layout.css@@ -1295,6 +1295,15 @@ main:has(.layout) > div {transition: padding 0.25s ease;}+/* The third lane of a lane page (the meeting beside the ticket) is a surface+ like the detail: white, the same even inset, the same one-line edge on the+ left. Not the light blue of the old chat lane. */+.layout--lane .column.panel {+ background: rgb(var(--white));+ padding: 1.5rem;+ border-left: 1px solid rgb(var(--cream-200));+}+.layout--lane.hide-content .column.content {display: block;padding: 0 !important;@@ -1442,32 +1451,14 @@ main:has(.layout) > div {box-shadow: 0 20px 44px -18px rgb(var(--ink) / 0.5);}-/* Panel focus mode: when BOTH a detail (content) and the panel lane are open,- the list collapses and the lane gains real reading width — the default 300px- lane squeezed all three columns. Panel open WITHOUT a selected item keeps the- list visible, otherwise the empty lane would strand the user with no way to- pick one; closing either one restores the default columns. Only the meetings- page renders a lane here (the tickets lane went with S4-T1, the knowledge chat- placeholder on 10.09.2026); the other pages always carry .hide-panel, so this- rule never fires there.- The board is not excluded any more: since it opens its ticket in the lane- (D4 of doc/kanban_ticket_als_bahn_plan.md) its grid has a list track like- the table's, and it yields the same way. */-.layout.two-column:not(.hide-content):not(.hide-panel) {- --panel-width: clamp(380px, 36vw, 560px);- grid-template-columns: 0px 1fr var(--panel-width);-}-.layout.two-column:not(.hide-content):not(.hide-panel) .list {- opacity: 0;- pointer-events: none;- transform: translateX(-100%);- padding: 0;-}--/* Companion-panel focus mode (assistant plan L12, S3a T4): the MIRROR of the- rule above, for the assistant panel docked to the left of the page instead of- a lane inside it. Same trade, same conditions: with the panel open and a- detail visible, the list yields its "pick something" job to the conversation.+/* The list yields (assistant plan L12, S3a T4; doc/ticket_meeting_panel_plan.md,+ decision 2): ONE rule for the two things that take room beside an open detail,+ the assistant docked to the left of the page and the meeting panel in the+ grid's third lane. With either open and a detail visible, the list gives up+ its "pick something" job, the detail keeps its room and the third lane gets a+ fixed width. Before the meeting panel this block had a twin for the lane+ ("panel focus mode", 36vw); no page filled the lane any more, and two rules+ for one trade drift apart.Without a selected detail (.hide-content) the list stays -- otherwise therewould be nothing left to pick from. The board yields like the table (D4):assistant open, ticket open, the board is at 0px and there is no handle;@@ -1482,9 +1473,12 @@ main:has(.layout) > div {Wrapped in the lg media query for the same reason as the content offset incomponents/assistant_panel.css: the panel is `hidden lg:block`, so below thatwidth there is no companion lane and nothing for the list to yield to. The- body class says "open", the media query says "and visible". */+ body class says "open", the media query says "and visible". The meeting panel+ needs no width of its own here: the ticket page is the phone page below+ 1024px (data-viewport-breakpoint-value), so its grid is never narrower. */@media (min-width: 1024px) {- body.assistant-panel-open .layout.two-column:not(.hide-content) {+ body.assistant-panel-open .layout.two-column:not(.hide-content),+ .layout.two-column:not(.hide-content):not(.hide-panel) {/* The lane width above is viewport-relative (36vw) because it was written fora grid that spans the window. With the assistant open, <main> is 636pxnarrower than the window, and 36vw of the WINDOW ate the content column:@@ -1499,7 +1493,8 @@ main:has(.layout) > div {grid-template-columns: 0px 1fr;column-gap: 0;}- body.assistant-panel-open .layout.two-column:not(.hide-content) .list {+ body.assistant-panel-open .layout.two-column:not(.hide-content) .list,+ .layout.two-column:not(.hide-content):not(.hide-panel) .list {opacity: 0;pointer-events: none;transform: translateX(-100%);@@ -1508,7 +1503,8 @@ main:has(.layout) > div {/* While the list track is 0 the handle is out of the picture: not visible,not a 25px drag surface inside the detail, not in the tab order (S6 ofdoc/kanban_ticket_als_bahn_plan.md). */- body.assistant-panel-open .layout.two-column:not(.hide-content) .lane-split {+ body.assistant-panel-open .layout.two-column:not(.hide-content) .lane-split,+ .layout.two-column:not(.hide-content):not(.hide-panel) .lane-split {display: none;}}diff --git a/app/components/neo_two_column_grid_component.html.erb b/app/components/neo_two_column_grid_component.html.erbindex a90ccab..4b9bdb6 100644--- a/app/components/neo_two_column_grid_component.html.erb+++ b/app/components/neo_two_column_grid_component.html.erb@@ -42,12 +42,13 @@<%= main_content %></main>- <!-- Panel Column (third lane), only for the page that fills it (meetings; knowledge dropped its chat placeholder on 10.09.2026) -->+ <!-- Panel Column (third lane), only for the page that fills it (tickets: the meeting beside the ticket) --><% if panel? %><aside class="column panel"><button class="icon-button panel-close opacity-50 hover:opacity-100"data-action="click->layout-toggle#togglePanel"- title="<%= panel_close_title.presence || I18n.t('views.shared.close_chat') %>"><i class="bi bi-x"></i></button>+ title="<%= panel_close_title.presence || I18n.t('views.shared.close_chat') %>"+ aria-label="<%= panel_close_title.presence || I18n.t('views.shared.close_chat') %>"><i class="bi bi-x" aria-hidden="true"></i></button><%= panel %></aside><% end %>diff --git a/app/controllers/organisations/ticket_meeting_panels_controller.rb b/app/controllers/organisations/ticket_meeting_panels_controller.rbnew file mode 100644index 0000000..c5f4499--- /dev/null+++ b/app/controllers/organisations/ticket_meeting_panels_controller.rb@@ -0,0 +1,70 @@+# frozen_string_literal: true++# The meeting beside the ticket (doc/ticket_meeting_panel_plan.md, S1): a read-only panel in+# the third lane of the ticket page's grid. It only reads, so there is no actor.+#+# * The ticket comes through TicketPolicy::Scope, within the project of the address.+# * The meetings are Tickets::LinkedMeetings: those that link to the ticket AND that this+# person may read, each judged against its OWN project (a moved ticket keeps links into+# its old project). ?meeting_id= picks one of them; without it the newest opens.+# * A project, ticket or meeting that is missing, not readable or of another organisation+# is the same 404 with the same body. Inside the frame it says "not available", so the+# panel does not show Turbo's "Content missing"; it tells nothing about which part failed.+# * Only a frame request of ticket_meeting_panel gets the panel. Any other request (a+# bookmark, a new tab, a modified click) goes to the meeting's own page.+module Organisations+ class TicketMeetingPanelsController < Organisations::BaseController+ FRAME_ID = 'ticket_meeting_panel'++ def show+ @project = Project.find_by(id: params[:project_id])+ @ticket = @project && policy_scope(Ticket).where(project: @project).find_by(id: params[:ticket_id])+ @meetings = @ticket ? newest_first(::Tickets::LinkedMeetings.call(ticket: @ticket, user: current_user)) : []+ @meeting = selected_meeting+ return unavailable if @meeting.nil?++ authorize @meeting, :show?+ return redirect_to(meeting_page) unless panel_request?++ @linked_tickets = linked_tickets+ render layout: false+ end++ private++ def newest_first(meetings)+ meetings.to_a.sort_by(&:occurred_at).reverse+ end++ def selected_meeting+ requested = params[:meeting_id]+ return @meetings.first if requested.blank?++ @meetings.find { |meeting| meeting.id == requested.to_s }+ end++ def panel_request?+ request.headers['Turbo-Frame'] == FRAME_ID+ end++ def meeting_page+ organisation_project_meetings_path(current_organisation, @meeting.project, meeting_id: @meeting.id)+ end++ # The tickets of the open meeting this person may read, oldest link first, each with+ # its own project (one may have moved). The ticket beside the panel is among them.+ def linked_tickets+ ids = @meeting.outgoing_references.where(target_type: Ticket.polymorphic_name)+ .order(:created_at).pluck(:target_id)+ readable = policy_scope(Ticket).where(id: ids).includes(:project).index_by(&:id)+ ids.filter_map { |id| readable[id] }+ end++ def unavailable+ skip_authorization+ raise ActiveRecord::RecordNotFound unless panel_request?++ render :unavailable, layout: false, status: :not_found+ end+ end+enddiff --git a/app/javascript/controllers/layout_toggle_controller.js b/app/javascript/controllers/layout_toggle_controller.jsindex 005fb72..8d77649 100644--- a/app/javascript/controllers/layout_toggle_controller.js+++ b/app/javascript/controllers/layout_toggle_controller.js@@ -51,7 +51,11 @@ export default class extends Controller {laneContext: { type: Object, default: {} },// Lane parameters of this visit the server did not open ({ name: value }):// a meeting_id it could not resolve, a new form it did not render.- unresolvedSelection: { type: Object, default: {} }+ unresolvedSelection: { type: Object, default: {} },+ // The frame of a third lane whose content IS its state (the meeting beside the+ // ticket, doc/ticket_meeting_panel_plan.md): open while it holds something,+ // emptied on close, never restored from storage and never in the address.+ panelFrameId: { type: String, default: "" }}connect() {@@ -93,6 +97,8 @@ export default class extends Controller {this.layoutState.categories = false}+ 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// in updateLayout(), the ONE place that flips hide-panel, so every reader of@@ -208,6 +214,7 @@ export default class extends Controller {// Error restoring state, keep current}}+ this.panelFromFrame()// Re-evaluate selection after frame load (rows might have been replaced)if (this.hasSelectedRow(event.target)) {@@ -427,11 +434,43 @@ export default class extends Controller {? this._categoriesBeforePanel: truedelete this._categoriesBeforePanel+ this.emptyPanelFrame()}this.updateLayout()}+ // The panel frame was filled (ticket-meeting-panel:open) or is to go+ // (ticket-meeting-panel:close, the panel's Escape and its ticket leaving the+ // lane). Both go through togglePanel, the one path that opens and closes it.+ openPanel() {+ if (!this.layoutState.panel) this.togglePanel()+ }++ closePanel() {+ if (this.layoutState.panel) this.togglePanel()+ }++ // A panel whose frame holds its state is open exactly while the frame holds+ // something: a stored "open" from an earlier visit would show an empty lane.+ panelFromFrame() {+ if (!this.panelFrameIdValue) return++ const frame = document.getElementById(this.panelFrameIdValue)+ this.layoutState.panel = Boolean(frame && frame.childElementCount > 0)+ }++ // 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).+ emptyPanelFrame() {+ if (!this.panelFrameIdValue) return++ const frame = document.getElementById(this.panelFrameIdValue)+ if (!frame) return+ frame.removeAttribute("src")+ frame.replaceChildren()+ }+// The lane's object is gone: close as the ✕ does, and take its names out of// the address in the SAME entry. A new entry would let Back reopen it.closeLane() {@@ -455,6 +494,8 @@ export default class extends Controller {}this.layoutState.content = false+ // The meeting beside the ticket belongs to the ticket (F3).+ this.closePanel()// Deselect the chosen row or card, wherever it is. .selected-row is the// one class of the list pages with a lane (tickets, knowledge and meetings,diff --git a/app/javascript/controllers/ticket_meeting_panel_controller.js b/app/javascript/controllers/ticket_meeting_panel_controller.jsnew file mode 100644index 0000000..28002a4--- /dev/null+++ b/app/javascript/controllers/ticket_meeting_panel_controller.js@@ -0,0 +1,81 @@+import { Controller } from "@hotwired/stimulus"+import { escapeOwned } from "escape_owner"++// The meeting beside the ticket (doc/ticket_meeting_panel_plan.md, S1), mounted on the+// content of turbo-frame#ticket_meeting_panel (tickets/_meeting_panel, and the "not+// available" answer). The lane belongs to layout_toggle; this controller only tells it+// 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;+// * 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+// most are streams that fire no load event, so the lane is watched instead.+export default class extends Controller {+ static values = { ticketId: String }++ connect() {+ this.dispatch("open")++ this.boundNoteEscape = this.noteEscape.bind(this)+ window.addEventListener("keydown", this.boundNoteEscape, true)+ this.boundCloseOnEscape = this.closeOnEscape.bind(this)+ document.addEventListener("keydown", this.boundCloseOnEscape)++ this.observeTicketLane()+ }++ disconnect() {+ window.removeEventListener("keydown", this.boundNoteEscape, true)+ document.removeEventListener("keydown", this.boundCloseOnEscape)+ this.laneObserver?.disconnect()+ }++ // While the lane shows this panel, the next Escape closes it.+ ownsEscape() {+ return this.isOpen+ }++ get isOpen() {+ const layout = this.element.closest(".layout")+ return Boolean(this.element.closest(".column.panel") && layout && !layout.classList.contains("hide-panel"))+ }++ close() {+ this.dispatch("close")+ }++ // Whether something above the panel (a dialog, a menu, a modal) owns this Escape,+ // asked before any listener has run, as layout_toggle asks for the lane.+ noteEscape(event) {+ if (event.key !== "Escape") return+ this.escapeAtKeydown = { event, ownedAbove: this.ownedAbove() }+ }++ closeOnEscape(event) {+ if (event.key !== "Escape" || event.defaultPrevented || !this.isOpen) return++ const noted = this.escapeAtKeydown+ const ownedAbove = noted?.event === event ? noted.ownedAbove : this.ownedAbove()+ if (ownedAbove) return++ event.preventDefault()+ this.close()+ }++ ownedAbove() {+ const others = (this.application?.controllers || []).filter(controller => controller !== this)+ return escapeOwned(others, document)+ }++ observeTicketLane() {+ const lane = document.getElementById("ticket_display_frame")+ if (!lane || !this.ticketIdValue) return++ this.laneObserver = new MutationObserver(() => {+ if (!lane.querySelector(`#ticket-content-${CSS.escape(this.ticketIdValue)}`)) 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.erbnew file mode 100644index 0000000..a265f7b--- /dev/null+++ b/app/views/organisations/meetings/_meeting_reading.html.erb@@ -0,0 +1,55 @@+<%# locals: (meeting:, participants:, can_write: false, lane_state: {}, current_frame_id: nil, panel: false) %>+<%# 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. %>+<div class="width-text">+ <%= render 'organisations/meetings/summary_section', meeting: meeting, can_write: can_write, lane_state: lane_state, refreshable: !panel %>++ <% if meeting.notes.blank? && meeting.transcript.blank? %>+ <div class="text-sm text-cream-600 italic py-2">+ <%= t('views.organisations.meetings.show.no_content') %>+ <% if can_write %>+ <%= link_to t('views.organisations.meetings.show.edit_meeting'),+ edit_organisation_project_meeting_path(+ @current_organisation,+ meeting.project,+ meeting,+ format: :turbo_stream,+ frame_id: current_frame_id,+ **lane_state.symbolize_keys,+ viewport: @viewport_mode+ ),+ data: { turbo_frame: current_frame_id },+ class: 'not-italic underline hover:text-ink' %>+ <% end %>+ </div>+ <% else %>+ <% if meeting.notes.present? %>+ <section class="mb-8">+ <h3 class="text-xs font-mono uppercase tracking-wider text-cream-600 mb-2">+ <%= t('views.organisations.meetings.show.notes_heading') %>+ </h3>+ <%= render Neo::MarkdownPreviewComponent.new(markdown: meeting_markdown_source(meeting.notes), size: :base) %>+ </section>+ <% end %>++ <% if meeting.transcript.present? %>+ <section>+ <h3 class="text-xs font-mono uppercase tracking-wider text-cream-600 mb-2">+ <%= t('views.organisations.meetings.show.transcript_heading') %>+ </h3>+ <% if panel || meeting.generated_summary.present? || meeting.notes.present? %>+ <%= render Neo::MarkdownPreviewComponent.new(+ markdown: meeting_transcript_source(meeting, participants),+ clamp: :tall,+ more_label: t('views.organisations.meetings.show.transcript_show_full'),+ less_label: t('views.organisations.meetings.show.transcript_collapse')) %>+ <% else %>+ <%= render Neo::MarkdownPreviewComponent.new(markdown: meeting_transcript_source(meeting, participants)) %>+ <% end %>+ </section>+ <% end %>+ <% end %>+</div>diff --git a/app/views/organisations/meetings/_meeting_show.html.erb b/app/views/organisations/meetings/_meeting_show.html.erbindex fc54462..1eb50b0 100644--- a/app/views/organisations/meetings/_meeting_show.html.erb+++ b/app/views/organisations/meetings/_meeting_show.html.erb@@ -31,27 +31,7 @@</div><% participants = meeting.meeting_participants.order(:created_at).to_a %>- <% if participants.any? %>- <% permitted_user_ids = meeting.project.permitted_user_ids.to_set %>- <div class="mt-3 flex min-w-0 flex-wrap items-start gap-2">- <span class="pt-0.5 text-xs font-mono uppercase tracking-wider text-cream-600">- <%= t('views.organisations.meetings.show.participants_heading') %>- </span>- <div class="flex min-w-0 flex-1 flex-wrap gap-2">- <% participants.each do |participant| %>- <% chip_style = meeting_participant_chip_style(meeting_participant_type(participant, permitted_user_ids)) %>- <%= render NeoTagComponent.new(- text: participant.display_name,- variant: chip_style[:variant],- icon: chip_style[:icon],- title: chip_style[:title],- size: :small,- class: 'max-w-full [&_.tag-text]:break-words [&_.tag-text]:[overflow-wrap:anywhere]'- ) %>- <% end %>- </div>- </div>- <% end %>+ <%= render 'organisations/meetings/participants_row', meeting: meeting, participants: participants %><% if meeting.organisation&.ai_enabled? %><%= render 'organisations/meetings/search_status', meeting: meeting, can_write: can_write %>@@ -59,55 +39,9 @@<div class="border-b border-cream-300 mt-5 mb-6"></div>- <div class="width-text">- <%= render 'organisations/meetings/summary_section', meeting: meeting, can_write: can_write, lane_state: meeting_lane_state %>-- <% if meeting.notes.blank? && meeting.transcript.blank? %>- <div class="text-sm text-cream-600 italic py-2">- <%= t('views.organisations.meetings.show.no_content') %>- <% if can_write %>- <%= link_to t('views.organisations.meetings.show.edit_meeting'),- edit_organisation_project_meeting_path(- @current_organisation,- meeting.project,- meeting,- format: :turbo_stream,- frame_id: current_frame_id,- **meeting_lane_state.symbolize_keys,- viewport: @viewport_mode- ),- data: { turbo_frame: current_frame_id },- class: 'not-italic underline hover:text-ink' %>- <% end %>- </div>- <% else %>- <% if meeting.notes.present? %>- <section class="mb-8">- <h3 class="text-xs font-mono uppercase tracking-wider text-cream-600 mb-2">- <%= t('views.organisations.meetings.show.notes_heading') %>- </h3>- <%= render Neo::MarkdownPreviewComponent.new(markdown: meeting_markdown_source(meeting.notes), size: :base) %>- </section>- <% end %>-- <% if meeting.transcript.present? %>- <section>- <h3 class="text-xs font-mono uppercase tracking-wider text-cream-600 mb-2">- <%= t('views.organisations.meetings.show.transcript_heading') %>- </h3>- <% if meeting.generated_summary.present? || meeting.notes.present? %>- <%= render Neo::MarkdownPreviewComponent.new(- markdown: meeting_transcript_source(meeting, participants),- clamp: :tall,- more_label: t('views.organisations.meetings.show.transcript_show_full'),- less_label: t('views.organisations.meetings.show.transcript_collapse')) %>- <% else %>- <%= render Neo::MarkdownPreviewComponent.new(markdown: meeting_transcript_source(meeting, participants)) %>- <% end %>- </section>- <% end %>- <% end %>- </div>+ <%= render 'organisations/meetings/meeting_reading',+ meeting: meeting, participants: participants, can_write: can_write,+ lane_state: meeting_lane_state, current_frame_id: current_frame_id %></div>diff --git a/app/views/organisations/meetings/_participants_row.html.erb b/app/views/organisations/meetings/_participants_row.html.erbnew file mode 100644index 0000000..7327650--- /dev/null+++ b/app/views/organisations/meetings/_participants_row.html.erb@@ -0,0 +1,25 @@+<%# locals: (meeting:, participants:) %>+<%# The participants of a meeting as chips, read only: the meeting's page and the panel+ beside a ticket render this one row. The caller loads the participants, because the+ transcript below needs the same list for its speaker names. %>+<% if participants.any? %>+ <% permitted_user_ids = meeting.project.permitted_user_ids.to_set %>+ <div class="mt-3 flex min-w-0 flex-wrap items-start gap-2">+ <span class="pt-0.5 text-xs font-mono uppercase tracking-wider text-cream-600">+ <%= t('views.organisations.meetings.show.participants_heading') %>+ </span>+ <div class="flex min-w-0 flex-1 flex-wrap gap-2">+ <% participants.each do |participant| %>+ <% chip_style = meeting_participant_chip_style(meeting_participant_type(participant, permitted_user_ids)) %>+ <%= render NeoTagComponent.new(+ text: participant.display_name,+ variant: chip_style[:variant],+ icon: chip_style[:icon],+ title: chip_style[:title],+ size: :small,+ class: 'max-w-full [&_.tag-text]:break-words [&_.tag-text]:[overflow-wrap:anywhere]'+ ) %>+ <% end %>+ </div>+ </div>+<% end %>diff --git a/app/views/organisations/meetings/_summary_section.html.erb b/app/views/organisations/meetings/_summary_section.html.erbindex 23b2a3a..88ad8c6 100644--- a/app/views/organisations/meetings/_summary_section.html.erb+++ b/app/views/organisations/meetings/_summary_section.html.erb@@ -16,6 +16,7 @@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 %><% ai_enabled = org&.ai_enabled? %><%# R2: asks the FEATURE this section offers — :meeting_summary, whose seam is@@ -70,11 +71,15 @@<i class="bi bi-arrow-repeat inline-block animate-spin" aria-hidden="true"></i><%= 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). %>- <%= 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' %>+ 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 %></p><% elsif summary.present? %><%# The LLM answers in Markdown ("**Kopf:**", "- Punkt"), so this goes through thediff --git a/app/views/organisations/notifications/_pane_ticket.html.erb b/app/views/organisations/notifications/_pane_ticket.html.erbindex 491b1ee..2939934 100644--- a/app/views/organisations/notifications/_pane_ticket.html.erb+++ b/app/views/organisations/notifications/_pane_ticket.html.erb@@ -63,8 +63,11 @@in the layout-owned turbo-frame#writing_surface (Paket 3); the update streamsthen refresh THIS ticket_display_frame, so the pane stays current. The inlinestatus forms still target "ticket_display_frame" directly — without this- frame in the pane → "Content missing". %>- <%= turbo_frame_tag 'ticket_display_frame' do %>+ frame in the pane → "Content missing".+ data-meeting-links: the pane is a quick look to answer, so a linked meeting+ shows as text without a link; to read it, open the ticket+ (tickets/_meeting_references_section). %>+ <%= turbo_frame_tag 'ticket_display_frame', data: { meeting_links: 'text' } do %><%= render 'organisations/tickets/ticket_display',ticket: @ticket,post: @post || Post.new(ticket: @ticket, user: current_user),diff --git a/app/views/organisations/ticket_meeting_panels/show.html.erb b/app/views/organisations/ticket_meeting_panels/show.html.erbnew file mode 100644index 0000000..df5950b--- /dev/null+++ b/app/views/organisations/ticket_meeting_panels/show.html.erb@@ -0,0 +1,4 @@+<%= turbo_frame_tag Organisations::TicketMeetingPanelsController::FRAME_ID do %>+ <%= render 'organisations/tickets/meeting_panel',+ ticket: @ticket, meeting: @meeting, meetings: @meetings, linked_tickets: @linked_tickets %>+<% end %>diff --git a/app/views/organisations/ticket_meeting_panels/unavailable.html.erb b/app/views/organisations/ticket_meeting_panels/unavailable.html.erbnew file mode 100644index 0000000..dd718db--- /dev/null+++ b/app/views/organisations/ticket_meeting_panels/unavailable.html.erb@@ -0,0 +1,8 @@+<%# One answer for a project, ticket or meeting that is missing, not readable or of another+ organisation: it names none of them. %>+<%= turbo_frame_tag Organisations::TicketMeetingPanelsController::FRAME_ID do %>+ <div class="ticket-meeting-panel" data-controller="ticket-meeting-panel"+ data-ticket-meeting-panel-ticket-id-value="<%= params[:ticket_id].to_s %>">+ <p class="ticket-meeting-panel__empty"><%= t('views.organisations.tickets.meeting_panel.unavailable') %></p>+ </div>+<% end %>diff --git a/app/views/organisations/tickets/_index_desktop.html.erb b/app/views/organisations/tickets/_index_desktop.html.erbindex 89bac6e..7da670a 100644--- a/app/views/organisations/tickets/_index_desktop.html.erb+++ b/app/views/organisations/tickets/_index_desktop.html.erb@@ -15,6 +15,7 @@selected_item: @selected_ticket,context_type: :tickets,css_classes: "kanban-layout #{lane_state} hide-panel",+ panel_close_title: t('views.organisations.tickets.meeting_panel.close'),additional_targets: { "index-page-target" => "layout" },chrome_height: NeoTwoColumnGridComponent::LANE_CHROME_HEIGHT_PX,lane: true@@ -29,6 +30,13 @@<% grid.with_main_content do %><%= render 'organisations/tickets/ticket_lane' %><% end %>++ <%# The meeting beside the ticket (doc/ticket_meeting_panel_plan.md): empty until a+ meeting of the open ticket is loaded into it; layout_toggle opens the lane on+ that load and empties it again on close. %>+ <% grid.with_panel do %>+ <%= turbo_frame_tag Organisations::TicketMeetingPanelsController::FRAME_ID %>+ <% end %><% end %><% else %><%# Table/List-Layout: ohne Sidebar (Filter Bar ersetzt SmartFolder-Sidebar) %>@@ -36,6 +44,7 @@selected_item: @selected_ticket,context_type: :tickets,css_classes: "#{lane_state} hide-panel",+ panel_close_title: t('views.organisations.tickets.meeting_panel.close'),additional_targets: { "index-page-target" => "layout", "column-picker-target" => "grid" },chrome_height: NeoTwoColumnGridComponent::LANE_CHROME_HEIGHT_PX,lane: true@@ -99,6 +108,13 @@<%= render 'organisations/tickets/ticket_lane' %><% end %>+ <%# The meeting beside the ticket (doc/ticket_meeting_panel_plan.md): empty until a+ meeting of the open ticket is loaded into it; layout_toggle opens the lane on+ that load and empties it again on close. %>+ <% grid.with_panel do %>+ <%= turbo_frame_tag Organisations::TicketMeetingPanelsController::FRAME_ID %>+ <% end %>+<% end %><% end %></div>diff --git a/app/views/organisations/tickets/_index_mobile.html.erb b/app/views/organisations/tickets/_index_mobile.html.erbindex d3fb667..9417e53 100644--- a/app/views/organisations/tickets/_index_mobile.html.erb+++ b/app/views/organisations/tickets/_index_mobile.html.erb@@ -1,7 +1,8 @@<% if @selected_ticket %><div class="mobile-ticket-detail"><%= link_to t('mobile.back_tickets'), organisation_project_tickets_path(@current_organisation, @project, request.query_parameters.except('ticket_id', 'id').merge('viewport' => 'mobile')), class: 'mobile-text-action', data: { turbo_frame: '_top' } %>- <turbo-frame id="ticket_display_frame">+ <%# data-meeting-links: a linked meeting leaves for the meetings page (tickets/_meeting_references_section). %>+ <turbo-frame id="ticket_display_frame" data-meeting-links="page"><%= render 'organisations/tickets/ticket_display', ticket: @selected_ticket, post: @post || Post.new(ticket: @selected_ticket, user: current_user), project: @project, current_organisation: @current_organisation %></turbo-frame></div>@@ -40,7 +41,7 @@</turbo-frame><dialog class="mobile-sheet" data-mobile-ticket-list-target="editor" aria-label="<%= t('mobile.edit_tickets') %>" data-action="click->mobile-ticket-list#backdrop close->mobile-ticket-list#editorClosed"><button class="mobile-text-action" type="button" data-action="mobile-ticket-list#closeEditor"><%= t('mobile.back_tickets') %></button>- <turbo-frame id="ticket_display_frame"></turbo-frame>+ <turbo-frame id="ticket_display_frame" data-meeting-links="page"></turbo-frame></dialog></div><% end %>diff --git a/app/views/organisations/tickets/_meeting_panel.html.erb b/app/views/organisations/tickets/_meeting_panel.html.erbnew file mode 100644index 0000000..c2f7ca4--- /dev/null+++ b/app/views/organisations/tickets/_meeting_panel.html.erb@@ -0,0 +1,91 @@+<%# locals: (ticket:, meeting:, meetings:, linked_tickets:) %>+<%# The meeting beside the ticket (doc/ticket_meeting_panel_plan.md, S1), the content of+ turbo-frame#ticket_meeting_panel in the grid's third lane. Read only: no edit, no delete,+ no analyses, no suggestions, no assistant entry point; "Open meeting" leads to the page+ where all of that lives.+ meetings: every meeting of this ticket the reader may see (Tickets::LinkedMeetings),+ newest first, as tabs in the head; a tab is a plain link, so it loads into this frame.+ The close button is the lane's own (NeoTwoColumnGridComponent, layout_toggle#togglePanel);+ ticket_meeting_panel_controller adds Escape and closes when the lane shows another ticket.+ ⚠️ Keys fully qualified: a lazy t('.') in a partial answers to the partial's name. %>+<% mp = 'views.organisations.tickets.meeting_panel' %>+<div class="ticket-meeting-panel"+ data-controller="ticket-meeting-panel"+ data-ticket-meeting-panel-ticket-id-value="<%= ticket.id %>">+ <header class="ticket-meeting-panel__head">+ <p class="text-xs font-mono uppercase tracking-wider text-cream-600"><%= t("#{mp}.eyebrow") %></p>+ <% if meetings.size > 1 %>+ <nav class="ticket-meeting-panel__tabs" aria-label="<%= t("#{mp}.tabs_label") %>">+ <% meetings.each do |other| %>+ <%= link_to organisation_project_ticket_meeting_panel_path(current_organisation, ticket.project, ticket, meeting_id: other.id),+ class: 'ticket-meeting-panel__tab',+ title: other.title,+ aria: { current: (other == meeting ? 'true' : nil) } do %>+ <span class="font-mono tabular-nums"><%= l(other.occurred_at.to_date, format: :short) %></span>+ <span class="truncate"><%= other.title %></span>+ <% end %>+ <% end %>+ </nav>+ <% end %>+ </header>++ <h2 class="mt-3 text-lg font-bold leading-snug text-cream-900 break-words [overflow-wrap:anywhere]"><%= meeting.title %></h2>+ <p class="mt-2 inline-flex items-center gap-1.5 text-xs text-cream-600">+ <i class="bi bi-calendar3" aria-hidden="true"></i>+ <%= display_time(meeting.occurred_at, user: current_user) %>+ </p>++ <% participants = meeting.meeting_participants.order(:created_at).to_a %>+ <%= render 'organisations/meetings/participants_row', meeting: meeting, participants: participants %>++ <div class="border-b border-cream-300 mt-4 mb-5"></div>++ <%= render 'organisations/meetings/meeting_reading', meeting: meeting, participants: participants, panel: true %>++ <% if linked_tickets.any? %>+ <section class="mt-8">+ <h3 class="text-xs font-mono uppercase tracking-wider text-cream-600 mb-2">+ <%= t("#{mp}.linked_tickets") %>+ </h3>+ <ul class="divide-y divide-cream-200 border-t border-cream-200">+ <% linked_tickets.each do |other| %>+ <li class="flex items-center gap-3 py-2 text-sm">+ <span class="shrink-0 font-mono text-xs tabular-nums text-cream-500">#<%= other.number %></span>+ <% if other == ticket %>+ <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. %>+ <%= 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' } %>+ <span class="shrink-0 truncate text-xs text-cream-500"><%= other.project.name %></span>+ <% end %>+ </li>+ <% end %>+ </ul>+ </section>+ <% end %>++ <p class="mt-8">+ <%= link_to organisation_project_meetings_path(current_organisation, meeting.project, meeting_id: meeting.id),+ class: 'inline-flex items-center gap-1.5 text-sm font-medium text-cream-900 underline hover:text-ink',+ data: { turbo_frame: '_top' } do %>+ <i class="bi bi-box-arrow-up-right" aria-hidden="true"></i>+ <%= t("#{mp}.open_meeting") %>+ <% end %>+ </p>+</div>diff --git a/app/views/organisations/tickets/_meeting_references_section.html.erb b/app/views/organisations/tickets/_meeting_references_section.html.erbindex ca6de21..f993182 100644--- a/app/views/organisations/tickets/_meeting_references_section.html.erb+++ b/app/views/organisations/tickets/_meeting_references_section.html.erb@@ -20,12 +20,24 @@<% meetings.each do |meeting| %><li class="flex items-center gap-3 px-3 py-2"><i class="bi bi-chat-quote shrink-0 text-xs text-cream-500" aria-hidden="true"></i>- <%# _top: this section renders inside ticket_display_frame (the lane, on- the list and on the board), but the meetings page has no frame with that id —- without the escape Turbo renders "Content missing" instead of navigating. %>+ <%# How an entry opens depends on the page around the ticket, and only the+ owner of turbo-frame#ticket_display_frame knows that page: it names it in+ data-meeting-links (panel: the list and the board, the meeting opens beside+ the ticket; text: the inbox pane, no link; page: the phone, the meetings+ page). Eight writers re-render this frame, several of them without knowing+ which page asked, so every entry carries the three forms and+ components/ticket_meeting_panel.css shows the one the frame names. Without+ a name it is page, the form that works everywhere.+ _top on the page link: this section renders inside ticket_display_frame,+ and the meetings page has no frame with that id. %>+ <% meeting_page = organisation_project_meetings_path(@current_organisation, meeting.project, meeting_id: meeting.id) %><%= link_to meeting.title,- organisation_project_meetings_path(@current_organisation, meeting.project, meeting_id: meeting.id),- class: 'flex-1 truncate text-sm text-cream-900 hover:underline',+ organisation_project_ticket_meeting_panel_path(@current_organisation, ticket.project, ticket, meeting_id: meeting.id),+ class: 'meeting-reference meeting-reference--panel flex-1 truncate text-sm text-cream-900 hover:underline',+ data: { turbo_frame: Organisations::TicketMeetingPanelsController::FRAME_ID } %>+ <span class="meeting-reference meeting-reference--text flex-1 truncate text-sm text-cream-900"><%= meeting.title %></span>+ <%= link_to meeting.title, meeting_page,+ class: 'meeting-reference meeting-reference--page flex-1 truncate text-sm text-cream-900 hover:underline',data: { turbo_frame: '_top' } %><span class="shrink-0 font-mono text-xs tabular-nums text-cream-500"><%= l(meeting.occurred_at.to_date, format: :default) %>diff --git a/app/views/organisations/tickets/_ticket_lane.html.erb b/app/views/organisations/tickets/_ticket_lane.html.erbindex 68bf8be..916ee7a 100644--- a/app/views/organisations/tickets/_ticket_lane.html.erb+++ b/app/views/organisations/tickets/_ticket_lane.html.erb@@ -2,8 +2,11 @@(doc/kanban_ticket_als_bahn_plan.md, section 4.1): the ticket in place, orthe placeholder. Rendered by both branches of _index_desktop, the table andthe board, and alone (layout: false) for a Turbo-Frame request of- ticket_display_frame, the fast path a row or card click takes. %>-<turbo-frame id="ticket_display_frame">+ ticket_display_frame, the fast path a row or card click takes.+ data-meeting-links: a linked meeting opens beside the ticket, in the grid's+ panel (tickets/_meeting_references_section). The frame element outlives every+ render into it, so the name holds for all of its writers. %>+<turbo-frame id="ticket_display_frame" data-meeting-links="panel"><% if @selected_ticket %><%= render 'organisations/tickets/ticket_display',ticket: @selected_ticket,diff --git a/app/views/organisations/tickets/index.html.erb b/app/views/organisations/tickets/index.html.erbindex 8fe884c..c4c7eec 100644--- a/app/views/organisations/tickets/index.html.erb+++ b/app/views/organisations/tickets/index.html.erb@@ -12,6 +12,10 @@data-controller="viewport"<% else %>data-controller="layout-toggle hover-arrows index-page keyboard-navigation ticket-direct-navigation viewport column-picker"+ <%# The meeting beside the ticket: its content opens and closes the grid's+ third lane (ticket_meeting_panel_controller -> layout_toggle). %>+ data-layout-toggle-panel-frame-id-value="<%= Organisations::TicketMeetingPanelsController::FRAME_ID %>"+ data-action="ticket-meeting-panel:open->layout-toggle#openPanel ticket-meeting-panel:close->layout-toggle#closePanel"<% end %>data-viewport-breakpoint-value="1024"data-column-picker-frame-value="tickets_list_frame"diff --git a/config/importmap.rb b/config/importmap.rbindex d2aabd4..6aa054d 100644--- a/config/importmap.rb+++ b/config/importmap.rb@@ -250,6 +250,7 @@ elsepin 'controllers/ticket_direct_navigation_controller', to: 'controllers/ticket_direct_navigation_controller.js'pin 'controllers/ticket_group_controller', to: 'controllers/ticket_group_controller.js'pin 'controllers/ticket_inline_edit_controller', to: 'controllers/ticket_inline_edit_controller.js'+ pin 'controllers/ticket_meeting_panel_controller', to: 'controllers/ticket_meeting_panel_controller.js'pin 'controllers/ticket_relation_modal_controller', to: 'controllers/ticket_relation_modal_controller.js'pin 'controllers/ticket_selection_controller', to: 'controllers/ticket_selection_controller.js'pin 'controllers/ticket_selector_controller', to: 'controllers/ticket_selector_controller.js'diff --git a/config/locales/views/tickets.de.yml b/config/locales/views/tickets.de.ymlindex a2aa9ad..70879d4 100644--- a/config/locales/views/tickets.de.yml+++ b/config/locales/views/tickets.de.yml@@ -227,6 +227,14 @@ de:user_not_assignable: Eine Person hat inzwischen keinen Zugang mehr zu diesem Projekt. Nichts wurde geändert.required: Pflichtfeld, der Wert kann nicht entfernt werden.internal_error: Der Durchlauf ist fehlgeschlagen. Nichts wurde geändert.+ meeting_panel:+ close: Meeting schließen+ eyebrow: Meeting zum Ticket+ tabs_label: Meetings dieses Tickets+ linked_tickets: Verknüpfte Tickets+ this_ticket: dieses Ticket+ open_meeting: Meeting öffnen+ unavailable: Dieses Meeting ist nicht verfügbar.shared:subtasks:heading: Unteraufgabendiff --git a/config/locales/views/tickets.en.yml b/config/locales/views/tickets.en.ymlindex 3dbf02e..3967a7d 100644--- a/config/locales/views/tickets.en.yml+++ b/config/locales/views/tickets.en.yml@@ -227,6 +227,14 @@ en:user_not_assignable: A person no longer has access to this project. Nothing was changed.required: Required field, the value cannot be cleared.internal_error: The run failed. Nothing was changed.+ meeting_panel:+ close: Close meeting+ eyebrow: Meeting of this ticket+ tabs_label: Meetings of this ticket+ linked_tickets: Linked tickets+ this_ticket: this ticket+ open_meeting: Open meeting+ unavailable: This meeting is not available.shared:subtasks:heading: Sub-tasksdiff --git a/config/routes.rb b/config/routes.rbindex 1cb99ed..b503e30 100644--- a/config/routes.rb+++ b/config/routes.rb@@ -738,6 +738,9 @@ Rails.application.routes.draw doresources :relations, only: %i[new create destroy], module: :tickets# The ticket view, open for a moment, marks the viewer's notifications about it read.resource :notification_read, only: %i[update], module: :tickets+ # The meeting beside the ticket, read only: a frame request renders the panel, any other+ # request goes to the meeting's own page (doc/ticket_meeting_panel_plan.md, S1).+ resource :meeting_panel, only: %i[show], controller: 'ticket_meeting_panels'# Notification subscription routesresource :subscription, only: [], controller: 'notification_subscriptions' dodiff --git a/spec/requests/organisations/ticket_meeting_panel_spec.rb b/spec/requests/organisations/ticket_meeting_panel_spec.rbnew file mode 100644index 0000000..d4984e6--- /dev/null+++ b/spec/requests/organisations/ticket_meeting_panel_spec.rb@@ -0,0 +1,438 @@+# frozen_string_literal: true++require 'rails_helper'++# The meeting beside the ticket (doc/ticket_meeting_panel_plan.md, S1). The panel reads a+# meeting of the ticket into turbo-frame#ticket_meeting_panel. Who may see which meeting is+# Tickets::LinkedMeetings (each meeting against its OWN project, S0); everything the reader+# may not see, and everything that does not exist, is one 404 with one body.+RSpec.describe 'Ticket meeting panel', :ci_guard, type: :request do+ let(:organisation) { create(:organisation) }+ let(:creator) { create(:user) }+ let(:project) { ActsAsTenant.with_tenant(organisation) { create(:project, organisation: organisation) } }+ let(:ticket) do+ ActsAsTenant.with_tenant(organisation) do+ create(:ticket, project: project, organisation: organisation, creator: creator, title: 'Ticket-With-Meetings')+ end+ end++ def meeting_in(target_project, title:, occurred_at: 1.day.ago, **attributes)+ ActsAsTenant.with_tenant(organisation) do+ create(:meeting, project: target_project, organisation: organisation, creator: creator,+ title: title, occurred_at: occurred_at, **attributes)+ end+ end++ def link(meeting, to: ticket)+ ActsAsTenant.with_tenant(organisation) do+ meeting.outgoing_references.create!(organisation: organisation, target: to, target_title_snapshot: to.display_title)+ end+ end++ def member(**access)+ create(:user).tap do |user|+ ActsAsTenant.with_tenant(organisation) do+ role = create(:role, title: "Role #{SecureRandom.hex(4)}", organisation: organisation)+ create(:membership, user: user, organisation: organisation, role: role, active: true)+ create(:project_permission, { user: user, project: project }.merge(access)) if access.any?+ end+ end+ end++ def grant(user, target_project, **access)+ ActsAsTenant.with_tenant(organisation) { create(:project_permission, user: user, project: target_project, **access) }+ end++ let(:reader) { member(tickets_access: 'read_only', meetings_access: 'read_only') }+ let(:frame) { { 'Turbo-Frame' => 'ticket_meeting_panel' } }++ def panel(meeting_id: nil, ticket_id: ticket.id, project_id: project.id, org: organisation, headers: frame)+ params = meeting_id ? { meeting_id: meeting_id } : {}+ get organisation_project_ticket_meeting_panel_path(org, project_id, ticket_id), params: params, headers: headers+ end++ def unavailable_text = I18n.t('views.organisations.tickets.meeting_panel.unavailable')++ describe 'a frame request' do+ let!(:meeting) do+ meeting_in(project, title: 'Kickoff-Panel-QX', notes: 'Notes-Body-QX', transcript: 'Transcript-Body-QX',+ generated_summary: 'Summary-Body-QX').tap { |m| link(m) }+ end++ before do+ ActsAsTenant.with_tenant(organisation) { create(:meeting_participant, meeting: meeting, display_name: 'Participant-QX') }+ end++ it 'renders the meeting into the panel frame' do+ sign_in reader+ panel++ expect(response).to have_http_status(:ok)+ document = Nokogiri::HTML(response.body)+ frame_element = document.at_css('turbo-frame#ticket_meeting_panel')+ expect(frame_element).not_to be_nil+ expect(frame_element.text).to include('Kickoff-Panel-QX', 'Participant-QX', 'Summary-Body-QX', 'Notes-Body-QX',+ 'Transcript-Body-QX')+ expect(frame_element.at_css('[data-controller~="ticket-meeting-panel"]')['data-ticket-meeting-panel-ticket-id-value'])+ .to eq(ticket.id)+ end++ it 'is read only: no form, no edit, delete, analyses, suggestions or assistant entry point' do+ sign_in member(tickets_access: 'read_write', meetings_access: 'read_write')+ panel++ expect(response).to have_http_status(:ok)+ body = response.body+ expect(body).not_to include('<form')+ expect(body).not_to include(edit_organisation_project_meeting_path(organisation, project, meeting))+ expect(body).not_to include('data-turbo-method')+ expect(body).not_to include('data-assistant-context')+ expect(body).not_to include('assistant-trigger')+ expect(body).not_to include(ActionView::RecordIdentifier.dom_id(meeting, :ticket_links))+ expect(body).not_to include('analyses')+ expect(body).not_to include('ticket_suggestions')+ end++ it 'collapses the transcript' do+ sign_in reader+ panel++ transcript = Nokogiri::HTML(response.body).css('[data-controller="clamp-toggle"]')+ .find { |node| node.text.include?('Transcript-Body-QX') }+ expect(transcript).not_to be_nil+ end++ it 'collapses the transcript also when it is the only text of the meeting' do+ only_transcript = meeting_in(project, title: 'Only-Transcript-QX', transcript: 'Lonely-Transcript-QX').tap { |m| link(m) }+ sign_in reader+ panel(meeting_id: only_transcript.id)++ transcript = Nokogiri::HTML(response.body).css('[data-controller="clamp-toggle"]')+ .find { |node| node.text.include?('Lonely-Transcript-QX') }+ expect(transcript).not_to be_nil+ end++ it 'offers the meeting page and leaves the frame for it' do+ sign_in reader+ panel++ anchor = Nokogiri::HTML(response.body)+ .at_css(%(a[href="#{organisation_project_meetings_path(organisation, project, meeting_id: meeting.id)}"]))+ expect(anchor).not_to be_nil+ expect(anchor['data-turbo-frame']).to eq('_top')+ end+ end++ describe 'several meetings' do+ let!(:older) { meeting_in(project, title: 'Older-QX', occurred_at: 3.days.ago).tap { |m| link(m) } }+ let!(:newest) { meeting_in(project, title: 'Newest-QX', occurred_at: 1.day.ago).tap { |m| link(m) } }++ it 'opens the newest and offers every meeting as a tab' do+ sign_in reader+ panel++ document = Nokogiri::HTML(response.body)+ expect(document.at_css('h2').text).to include('Newest-QX')+ tabs = document.css('nav.ticket-meeting-panel__tabs a')+ expect(tabs.map { |tab| tab['href'] }).to eq([+ organisation_project_ticket_meeting_panel_path(organisation, project, ticket, meeting_id: newest.id),+ organisation_project_ticket_meeting_panel_path(organisation, project, ticket, meeting_id: older.id)+ ])+ expect(tabs.first['aria-current']).to eq('true')+ expect(tabs.last['aria-current']).to be_nil+ end++ it 'opens the meeting a tab names' do+ sign_in reader+ panel(meeting_id: older.id)++ expect(Nokogiri::HTML(response.body).at_css('h2').text).to include('Older-QX')+ end++ it 'shows no tabs for a single meeting' do+ single = ActsAsTenant.with_tenant(organisation) do+ create(:ticket, project: project, organisation: organisation, creator: creator)+ end+ link(older, to: single)+ sign_in reader+ panel(ticket_id: single.id)++ expect(response).to have_http_status(:ok)+ expect(response.body).not_to include('ticket-meeting-panel__tabs')+ end+ end++ describe 'the linked tickets of the open meeting' do+ let(:meeting) { meeting_in(project, title: 'Linked-Tickets-QX').tap { |m| link(m) } }+ let(:sibling) do+ ActsAsTenant.with_tenant(organisation) do+ create(:ticket, project: project, organisation: organisation, creator: creator, title: 'Sibling-QX')+ end+ end+ let(:elsewhere_project) { ActsAsTenant.with_tenant(organisation) { create(:project, organisation: organisation) } }+ let(:elsewhere) do+ ActsAsTenant.with_tenant(organisation) do+ create(:ticket, project: elsewhere_project, organisation: organisation, creator: creator, title: 'Elsewhere-QX')+ end+ end++ before do+ link(meeting, to: sibling)+ link(meeting, to: elsewhere)+ end++ it 'opens a ticket of this project in the lane, names this ticket without a link' do+ sign_in reader+ 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')+ 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')+ end++ it 'hides a linked ticket the reader may not read' do+ sign_in reader+ panel++ expect(response.body).not_to include('Elsewhere-QX')+ end++ it 'leaves the page for a readable ticket of another project' do+ user = reader+ grant(user, elsewhere_project, tickets_access: 'read_only')+ sign_in user+ panel++ anchor = Nokogiri::HTML(response.body)+ .at_css(%(a[href="#{organisation_project_tickets_path(organisation, elsewhere_project, ticket_id: elsewhere.id)}"]))+ expect(anchor['data-turbo-frame']).to eq('_top')+ end+ end++ describe 'what is not there, or not for this reader' do+ let(:meeting) { meeting_in(project, title: 'Hidden-QX').tap { |m| link(m) } }++ def expect_unavailable+ expect(response).to have_http_status(:not_found)+ expect(response.body).to include('turbo-frame id="ticket_meeting_panel"', unavailable_text)+ expect(response.body).not_to include('Hidden-QX')+ end++ it 'is a 404 for a meeting that does not link to the ticket' do+ unlinked = meeting_in(project, title: 'Unlinked-QX')+ meeting+ sign_in reader+ panel(meeting_id: unlinked.id)++ expect_unavailable+ expect(response.body).not_to include('Unlinked-QX')+ end++ it 'is a 404 for a meeting id that does not exist' do+ meeting+ sign_in reader+ panel(meeting_id: SecureRandom.uuid)++ expect_unavailable+ end++ it 'is a 404 for a ticket that does not exist' do+ sign_in reader+ panel(ticket_id: SecureRandom.uuid)++ expect_unavailable+ end++ it 'is a 404 without meetings read' do+ meeting+ sign_in member(tickets_access: 'read_only')+ panel(meeting_id: meeting.id)++ expect_unavailable+ end++ it 'is a 404 without tickets read' do+ meeting+ sign_in member(meetings_access: 'read_only')+ panel(meeting_id: meeting.id)++ expect_unavailable+ end++ it 'answers every one of these with the same body' do+ meeting+ bodies = []+ sign_in reader+ panel(meeting_id: SecureRandom.uuid)+ bodies << response.body+ panel(meeting_id: meeting_in(project, title: 'Other-QX').id)+ bodies << response.body+ sign_in member(tickets_access: 'read_only')+ panel(meeting_id: meeting.id)+ bodies << response.body+ sign_in member(meetings_access: 'read_only')+ panel(meeting_id: meeting.id)+ bodies << response.body++ expect(bodies.uniq.size).to eq(1)+ end++ it 'shows nothing of another organisation' do+ meeting+ foreign_org = create(:organisation)+ foreign_project = ActsAsTenant.with_tenant(foreign_org) { create(:project, organisation: foreign_org) }+ sign_in reader+ panel(org: foreign_org, project_id: foreign_project.id)++ # Not a member there: the organisation filter answers before this controller does.+ expect(response).not_to have_http_status(:ok)+ expect(response.body).not_to include('Hidden-QX')+ end++ it 'shows nothing of another organisation through this organisation' do+ foreign_org = create(:organisation)+ foreign_project = ActsAsTenant.with_tenant(foreign_org) { create(:project, organisation: foreign_org) }+ foreign_ticket = ActsAsTenant.with_tenant(foreign_org) do+ create(:ticket, project: foreign_project, organisation: foreign_org, creator: creator)+ end+ sign_in reader+ panel(project_id: foreign_project.id, ticket_id: foreign_ticket.id)++ expect_unavailable+ end+ end++ # S0: a ticket moved out of its meeting's project keeps the link. The panel judges the+ # meeting against the MEETING's project.+ describe 'a ticket moved to another project' do+ let(:project_b) { ActsAsTenant.with_tenant(organisation) { create(:project, organisation: organisation) } }+ let(:meeting) { meeting_in(project, title: 'Before-Move-QX').tap { |m| link(m) } }++ before do+ meeting+ ActsAsTenant.with_tenant(organisation) do+ grant(creator, project, tickets_access: 'read_write', meetings_access: 'read_write')+ grant(creator, project_b, tickets_access: 'read_write', meetings_access: 'read_write')+ Tickets::Mover.call(ticket: ticket, target_project: project_b, current_user: creator)+ end+ end++ it 'is a 404 for a reader of meetings in the new project only' do+ user = member+ grant(user, project_b, tickets_access: 'read_only', meetings_access: 'read_only')+ sign_in user+ panel(project_id: project_b.id)++ expect(response).to have_http_status(:not_found)+ expect(response.body).not_to include('Before-Move-QX')+ end++ it "shows the meeting to a reader of meetings in the meeting's project" do+ user = member(meetings_access: 'read_only')+ grant(user, project_b, tickets_access: 'read_only')+ sign_in user+ panel(project_id: project_b.id)++ expect(response).to have_http_status(:ok)+ expect(response.body).to include('Before-Move-QX')+ expect(response.body).to include(organisation_project_meetings_path(organisation, project, meeting_id: meeting.id))+ end+ end++ describe 'a request that is not for the panel frame' do+ let(:meeting) { meeting_in(project, title: 'Redirect-QX').tap { |m| link(m) } }++ it "goes to the meeting's own page" do+ meeting+ sign_in reader+ panel(meeting_id: meeting.id, headers: {})++ expect(response).to redirect_to(organisation_project_meetings_path(organisation, project, meeting_id: meeting.id))+ end++ it 'goes to the newest meeting without a meeting id' do+ meeting+ sign_in reader+ panel(headers: {})++ expect(response).to redirect_to(organisation_project_meetings_path(organisation, project, meeting_id: meeting.id))+ end++ it 'goes to the meeting page also for a request of another frame' do+ meeting+ sign_in reader+ panel(meeting_id: meeting.id, headers: { 'Turbo-Frame' => 'ticket_display_frame' })++ expect(response).to have_http_status(:redirect)+ end++ it 'is a plain 404 for what is not there' do+ sign_in reader+ panel(meeting_id: SecureRandom.uuid, headers: {})++ # The test environment's 404 page prints the spec source; the status is the answer.+ expect(response).to have_http_status(:not_found)+ end+ end++ # How an entry of the ticket's meetings section opens is named by the owner of+ # turbo-frame#ticket_display_frame (components/ticket_meeting_panel.css shows that form).+ describe "the ticket's meetings section" do+ let(:meeting) { meeting_in(project, title: 'Section-QX').tap { |m| link(m) } }++ it 'carries the panel, text and page forms of every entry' do+ meeting+ sign_in reader+ get organisation_project_ticket_path(organisation, project, ticket)++ entry = Nokogiri::HTML(response.body).at_css("#meeting-references-#{ticket.id} li")+ panel_link = entry.at_css('a.meeting-reference--panel')+ expect(panel_link['href']).to eq(organisation_project_ticket_meeting_panel_path(organisation, project, ticket, meeting_id: meeting.id))+ expect(panel_link['data-turbo-frame']).to eq('ticket_meeting_panel')+ expect(entry.at_css('span.meeting-reference--text').text).to eq('Section-QX')+ expect(entry.at_css('a.meeting-reference--page')['data-turbo-frame']).to eq('_top')+ end++ it 'names the panel form on the lane of the ticket page and offers the empty panel frame' do+ meeting+ sign_in reader+ get organisation_project_tickets_path(organisation, project, ticket_id: ticket.id)++ document = Nokogiri::HTML(response.body)+ expect(document.at_css('turbo-frame#ticket_display_frame')['data-meeting-links']).to eq('panel')+ panel_frame = document.at_css('.layout aside.column.panel turbo-frame#ticket_meeting_panel')+ expect(panel_frame).not_to be_nil+ expect(panel_frame.children.reject(&:text?)).to be_empty+ expect(document.at_css('.layout')['class']).to include('hide-panel')+ end++ it 'names the page form on the phone' do+ meeting+ sign_in reader+ get organisation_project_tickets_path(organisation, project, ticket_id: ticket.id, viewport: 'mobile')++ expect(Nokogiri::HTML(response.body).at_css('turbo-frame#ticket_display_frame')['data-meeting-links']).to eq('page')+ end++ it 'names the text form in the inbox pane' do+ meeting+ user = reader+ notification = ActsAsTenant.with_tenant(organisation) do+ create(:notification, recipient: user, organisation: organisation, project: project,+ notifiable: ticket, channel: 'in_app', state: :delivered)+ end+ sign_in user+ Prosopite.pause+ get organisation_notifications_path(organisation), params: { notification: notification.id }+ Prosopite.resume++ document = Nokogiri::HTML(response.body)+ expect(document.at_css('turbo-frame#ticket_display_frame')['data-meeting-links']).to eq('text')+ expect(document.at_css("#meeting-references-#{ticket.id} span.meeting-reference--text").text).to eq('Section-QX')+ end+ end+enddiff --git a/spec/system/ticket_meeting_panel_spec.rb b/spec/system/ticket_meeting_panel_spec.rbnew file mode 100644index 0000000..5a81df8--- /dev/null+++ b/spec/system/ticket_meeting_panel_spec.rb@@ -0,0 +1,145 @@+# frozen_string_literal: true++require 'rails_helper'++# The meeting beside the ticket, clicked for real (doc/ticket_meeting_panel_plan.md, S1).+# What markup cannot prove: the panel opens from the ticket's meetings section without a+# page change, the list yields while it is open, Escape closes the panel before the lane,+# the ✕ closes and empties it, and another ticket in the lane closes it (F3). And the inbox+# pane shows the meeting as text, the one form its frame names.+RSpec.describe 'Meeting beside the ticket', type: :system do+ let(:organisation) { create(:organisation) }+ let(:user) { create(:user) }+ let(:project) { create(:project, organisation: organisation) }+ let(:mp) { 'views.organisations.tickets.meeting_panel' }++ before do+ driven_by :selenium_chrome_headless_full+ Prosopite.pause+ ActsAsTenant.current_tenant = organisation+ create(:membership, user: user, organisation: organisation, role: create(:admin_role, organisation: organisation),+ active: true)+ sign_in user+ end++ # After the before block above: they need its tenant.+ let!(:ticket) { create(:ticket, project: project, title: 'Ticket beside a meeting', creator: user) }+ let!(:sibling) { create(:ticket, project: project, title: 'Sibling from the meeting', creator: user) }+ let!(:meeting) do+ create(:meeting, project: project, title: 'Planning call', creator: user, occurred_at: 2.days.ago,+ notes: 'Agreed to ship on Friday.').tap do |m|+ [ticket, sibling].each do |target|+ m.outgoing_references.create!(organisation: organisation, target: target, target_title_snapshot: target.display_title)+ end+ end+ end++ after do+ ActsAsTenant.current_tenant = nil+ Prosopite.resume+ end++ def lane_path(of = ticket)+ organisation_project_tickets_path(organisation, project, ticket_id: of.id)+ end++ def mark_page+ page.execute_script('window.__meetingPanelPageMark = true')+ end++ def same_page?+ page.evaluate_script('window.__meetingPanelPageMark === true')+ end++ def width_of(selector)+ page.evaluate_script("Math.round(document.querySelector(#{selector.to_json}).getBoundingClientRect().width)")+ end++ def open_panel+ within("#meeting-references-#{ticket.id}") { click_link 'Planning call' }+ expect(page).to have_css('aside.column.panel h2', text: 'Planning call')+ end++ def expect_panel_closed+ expect(page).to have_css('.layout.hide-panel')+ expect(page).to have_no_css('aside.column.panel h2')+ expect(page.evaluate_script("document.getElementById('ticket_meeting_panel').childElementCount")).to eq(0)+ end++ it 'opens the meeting beside the ticket, the list yields, and Escape closes the panel before the lane' do+ visit lane_path+ expect(page).to have_css("#ticket-content-#{ticket.id}")+ mark_page+ expect(width_of('.layout .column.list')).to be > 200++ open_panel++ expect(same_page?).to be(true)+ expect(page).to have_css("#ticket-content-#{ticket.id}")+ expect(page).to have_text('Agreed to ship on Friday.')+ expect(width_of('.layout .column.list')).to eq(0)+ expect(width_of('.layout .column.panel')).to be_between(320, 480)+ expect(page).to have_current_path(lane_path)++ find('body').send_keys(:escape)+ expect_panel_closed+ expect(page).to have_css("#ticket-content-#{ticket.id}")+ expect(width_of('.layout .column.list')).to be > 200++ find('body').send_keys(:escape)+ expect(page).to have_css('.layout.hide-content')+ end++ it 'closes and empties the panel with its ✕' do+ visit lane_path+ open_panel++ find('aside.column.panel .panel-close').click++ expect_panel_closed+ expect(page).to have_css("#ticket-content-#{ticket.id}")+ end++ it 'closes the panel when the lane shows another ticket' do+ visit lane_path+ mark_page+ open_panel++ within('aside.column.panel') { click_link 'Sibling from the meeting' }++ expect(page).to have_css("#ticket-content-#{sibling.id}")+ expect_panel_closed+ expect(same_page?).to be(true)+ expect(page).to have_current_path(lane_path(sibling))+ end++ it 'closes the panel when the lane closes' do+ visit lane_path+ open_panel++ within('#ticket-header') { find('[data-action="click->layout-toggle#closeContent"]', match: :first).click }++ expect(page).to have_css('.layout.hide-content')+ expect_panel_closed+ end++ it 'shows the meeting as text without a link in the inbox pane' do+ notification = create(:notification, recipient: user, organisation: organisation, project: project,+ notifiable: ticket, channel: 'in_app', state: :delivered)+ visit organisation_notifications_path(organisation, notification: notification.id)++ within("#meeting-references-#{ticket.id}") do+ expect(page).to have_css('span.meeting-reference--text', text: 'Planning call', visible: :visible)+ expect(page).to have_no_link('Planning call')+ end+ end++ it 'leaves for the meetings page from the phone layout' do+ visit organisation_project_tickets_path(organisation, project, ticket_id: ticket.id, viewport: 'mobile')++ within("#meeting-references-#{ticket.id}") do+ expect(page).to have_css('a.meeting-reference--page', text: 'Planning call', visible: :visible)+ expect(page).to have_no_css('a.meeting-reference--panel', visible: :visible)+ end+ end+end