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.

Let an organisation choose an inbox project for meetings

Guido Boykeb4758a9bfe2e
diff --git a/app/components/neo_sidebar_project_item_component.html.erb b/app/components/neo_sidebar_project_item_component.html.erb
index 0970159..3fb7906 100644
--- a/app/components/neo_sidebar_project_item_component.html.erb
+++ b/app/components/neo_sidebar_project_item_component.html.erb
@@ -26,6 +26,9 @@
<% end %>
<% end %>
+ <% if @project.meeting_inbox? %>
+ <i class="bi bi-inbox text-xs text-cream-700 shrink-0 mr-1" role="img" aria-label="<%= t('navigation.meeting_inbox') %>" title="<%= t('navigation.meeting_inbox') %>"></i>
+ <% end %>
<%= pin_toggle(group: 'proj') %>
</div>
diff --git a/app/controllers/organisations/organisation_settings_controller.rb b/app/controllers/organisations/organisation_settings_controller.rb
index 816e8bc..bb770d2 100644
--- a/app/controllers/organisations/organisation_settings_controller.rb
+++ b/app/controllers/organisations/organisation_settings_controller.rb
@@ -2,6 +2,8 @@
module Organisations
class OrganisationSettingsController < BaseController
+ before_action :set_inbox_project_choices
+
def show
authorize @current_organisation, :update?
end
@@ -23,7 +25,17 @@ module Organisations
# Subdomain/domain are parked (custom-access-domain feature deferred); the form no
# longer exposes them, so we do not accept them via mass-assignment either. Re-add
# `:subdomain, :domain` here when the fields return to the settings view.
- params.require(:organisation).permit(:name)
+ params.require(:organisation).permit(:name, :meeting_inbox_project_id)
+ end
+
+ # The active projects, plus the stored one when it is archived: left out, the
+ # select would submit nothing for it and every save of this form would clear
+ # an inbox that comes back on restore.
+ def set_inbox_project_choices
+ stored = @current_organisation.meeting_inbox_project_id
+ @inbox_project_choices = @current_organisation.projects.where(archived_at: nil).or(
+ @current_organisation.projects.where(id: stored)
+ ).order(:name)
end
end
end
diff --git a/app/helpers/meetings_helper.rb b/app/helpers/meetings_helper.rb
index 6697bad..96d0234 100644
--- a/app/helpers/meetings_helper.rb
+++ b/app/helpers/meetings_helper.rb
@@ -6,6 +6,14 @@ module MeetingsHelper
# lib/list_row/address.js): narrower, a lane would cover the list.
LANE_FULL_PAGE_BELOW_PX = 1024
+ # The choices of the inbox select in the organisation settings.
+ def meeting_inbox_options(projects)
+ projects.map do |project|
+ label = project.archived? ? t('organisations.organisation_settings.show.meeting_inbox_archived_option', name: project.name) : project.name
+ [label, project.id]
+ end
+ end
+
def meeting_list_state(pagy: nil)
state = Meetings::ListState.extract(params)
state['page'] = pagy.page.to_s if pagy && state.key?('page')
diff --git a/app/models/organisation.rb b/app/models/organisation.rb
index 7bdf0bd..a03c547 100644
--- a/app/models/organisation.rb
+++ b/app/models/organisation.rb
@@ -39,6 +39,7 @@
# ai_package_id :uuid
# ai_package_selected_by_id :uuid
# embedding_organization_id :string
+# meeting_inbox_project_id :uuid
#
# Indexes
#
@@ -46,6 +47,7 @@
# index_organisations_on_ai_activated_by_id (ai_activated_by_id)
# index_organisations_on_ai_package_id (ai_package_id)
# index_organisations_on_ai_provider (ai_provider)
+# index_organisations_on_meeting_inbox_project_id (meeting_inbox_project_id)
# index_organisations_on_notification_sender_email (notification_sender_email)
#
# Foreign Keys
@@ -55,6 +57,7 @@
# fk_rails_... (ai_activated_by_id => users.id) ON DELETE => nullify
# fk_rails_... (ai_package_id => ai_packages.id)
# fk_rails_... (ai_package_selected_by_id => users.id) ON DELETE => nullify
+# fk_rails_... (meeting_inbox_project_id => projects.id) ON DELETE => nullify
#
class Organisation < ApplicationRecord
@@ -101,6 +104,9 @@ class Organisation < ApplicationRecord
has_many :invitations, dependent: :destroy
has_many :roles, dependent: :destroy
has_many :projects, dependent: :destroy
+ # Read it through #meeting_inbox: the column alone does not say whether the
+ # project still takes meetings.
+ belongs_to :meeting_inbox_project, class_name: 'Project', optional: true, inverse_of: false
has_many :tickets, through: :projects
has_many :smart_folders, dependent: :destroy
# Project#view_configurations takes the rows of a project; this one takes the
@@ -204,6 +210,7 @@ class Organisation < ApplicationRecord
# Validations
validates :name, presence: true, uniqueness: true
+ validate :meeting_inbox_project_usable, if: :meeting_inbox_project_id_changed?
# S1 honest facade: the org chat provider must be one the Factory can actually
# build. Lazy `in:` (evaluated per validation) reads AiCredential.implemented_providers
# so this allow-list can never drift from the Factory registry. Conditional
@@ -333,6 +340,15 @@ class Organisation < ApplicationRecord
# derivation, deliberately without a third column in the schema.
#
# @return [Boolean]
+ # The project meetings without a project land in, or nil. An archived project
+ # takes no meetings, so it counts as not set; the column stays, restoring the
+ # project brings the inbox back. Sets its own tenant: Project requires one, and
+ # a token request reads this before it has entered the project.
+ def meeting_inbox
+ project = ActsAsTenant.with_tenant(self) { meeting_inbox_project }
+ project unless project.nil? || project.archived?
+ end
+
def ai_custom_access_configured?
has_own_ai_credentials?(ai_provider.presence || AiCredential::PROVIDER_OPENAI)
end
@@ -616,6 +632,15 @@ class Organisation < ApplicationRecord
private
+ # A foreign project is out of reach of every reader of this column, an
+ # archived one would be an inbox that takes nothing from the first moment.
+ def meeting_inbox_project_usable
+ return if meeting_inbox_project_id.nil?
+
+ project = ActsAsTenant.with_tenant(self) { projects.find_by(id: meeting_inbox_project_id) }
+ errors.add(:meeting_inbox_project_id, :not_usable) if project.nil? || project.archived?
+ end
+
# The embedding twin of own_ai_token_usable?, on the independent embedding_*
# columns. Same branches for the same reasons (the sk-/org- rule is the one key
# format we own the knowledge of; Vertex is service-account-only or EU residency is
diff --git a/app/models/project.rb b/app/models/project.rb
index c470f33..03d3e97 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -113,6 +113,12 @@ class Project < ApplicationRecord
update!(archived_at: nil, archived_by: nil)
end
+ # The organisation's project for meetings sent without one
+ # (Organisation#meeting_inbox).
+ def meeting_inbox?
+ !archived? && organisation&.meeting_inbox_project_id == id
+ end
+
# Find users who have access to this project — delegates to ProjectAccessService.
# Correctly accounts for no_access overrides.
def users_with_access(action = :read, area = :tickets)
diff --git a/app/views/organisations/organisation_settings/show.html.erb b/app/views/organisations/organisation_settings/show.html.erb
index 29ab755..e29717c 100644
--- a/app/views/organisations/organisation_settings/show.html.erb
+++ b/app/views/organisations/organisation_settings/show.html.erb
@@ -46,6 +46,23 @@
</div>
</div>
+ <%# Row: Meeting inbox %>
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-2 md:gap-8 py-6 border-b border-cream-200">
+ <div class="md:col-span-1">
+ <%= form.label :meeting_inbox_project_id, t('.meeting_inbox_label'), class: "block text-sm font-bold text-cream-900" %>
+ <p class="text-xs text-cream-600 mt-1"><%= t('.meeting_inbox_hint') %></p>
+ </div>
+ <div class="md:col-span-2">
+ <%= form.select :meeting_inbox_project_id,
+ options_for_select(meeting_inbox_options(@inbox_project_choices), @current_organisation.meeting_inbox_project_id),
+ { include_blank: t('.meeting_inbox_none') },
+ class: "w-full h-10 px-4 rounded border border-cream-300 focus:outline-none focus:border-ink focus:ring-1 focus:ring-ink transition-all bg-surface-raised" %>
+ <% if @current_organisation.meeting_inbox_project_id.present? && @current_organisation.meeting_inbox.nil? %>
+ <p class="text-xs text-cream-600 mt-2"><%= t('.meeting_inbox_archived_hint') %></p>
+ <% end %>
+ </div>
+ </div>
+
<%# Subdomain/Domain rows are parked: the custom-access-domain feature is deferred,
so the fields are hidden from users for now. DB columns, existing values and the
`.subdomain_*`/`.domain_*` locale copy are kept intact for a frictionless re-enable
diff --git a/app/views/organisations/projects/show.html.erb b/app/views/organisations/projects/show.html.erb
index e8abb86..95469ca 100644
--- a/app/views/organisations/projects/show.html.erb
+++ b/app/views/organisations/projects/show.html.erb
@@ -13,7 +13,7 @@
<!-- Project Dashboard Header -->
<%= render NeoTitleBoxComponent.new(
title: t('.dashboard_title'),
- subtitle: @project.name,
+ subtitle: @project.meeting_inbox? ? t('.meeting_inbox_subtitle', name: @project.name) : @project.name,
variant: :project
) do |component| %>
<% component.with_right_content do %>
diff --git a/config/locales/de.yml b/config/locales/de.yml
index 0a4310b..8c712b4 100644
--- a/config/locales/de.yml
+++ b/config/locales/de.yml
@@ -1490,6 +1490,7 @@ de:
separator: ","
delimiter: "."
navigation:
+ meeting_inbox: Eingang für Meetings
all_meetings: Alle Meetings
people: Personen
all_organisations: Alle Organisationen
@@ -1992,6 +1993,11 @@ de:
domain_label: Domain
domain_placeholder: beispiel.de
domain_hint: Die Domain Ihrer Organisation (optional)
+ meeting_inbox_label: Eingangsprojekt
+ meeting_inbox_hint: Hierhin kommen Meetings, die ein Programm ohne Projekt anlegt. Von dort lassen sie sich in ihr Projekt verschieben.
+ meeting_inbox_none: Kein Eingangsprojekt
+ meeting_inbox_archived_hint: Dieses Projekt ist archiviert und nimmt keine Meetings an. Nach dem Wiederherstellen gilt es wieder als Eingang.
+ meeting_inbox_archived_option: '%{name} (archiviert)'
save_button: Speichern
posts:
post:
@@ -2091,6 +2097,7 @@ de:
current_notes: Aktuelle Notizen
current_tasks: Aktuelle Tickets
dashboard_title: Dashboard
+ meeting_inbox_subtitle: '%{name} · Eingang'
description: Beschreibung
documents_card_title: Dokumente
edit: Bearbeiten
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 461a52d..8956106 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1384,6 +1384,7 @@ en:
separator: "."
delimiter: ","
navigation:
+ meeting_inbox: Inbox for meetings
all_meetings: All Meetings
people: People
all_organisations: All organisations
@@ -1904,6 +1905,11 @@ en:
domain_label: Domain
domain_placeholder: example.com
domain_hint: Your organisation's domain (optional)
+ meeting_inbox_label: Inbox project
+ meeting_inbox_hint: Meetings a program creates without a project land here. From there they can be moved to their project.
+ meeting_inbox_none: No inbox project
+ meeting_inbox_archived_hint: This project is archived and takes no meetings. Once restored it is the inbox again.
+ meeting_inbox_archived_option: '%{name} (archived)'
save_button: Save
posts:
post:
@@ -2003,6 +2009,7 @@ en:
current_notes: Current Notes
current_tasks: Current Tickets
dashboard_title: Dashboard
+ meeting_inbox_subtitle: '%{name} · Inbox'
description: Description
documents_card_title: Documents
edit: Edit
diff --git a/config/locales/models.de.yml b/config/locales/models.de.yml
index 266ae05..605a2a3 100644
--- a/config/locales/models.de.yml
+++ b/config/locales/models.de.yml
@@ -2,6 +2,8 @@
de:
activerecord:
attributes:
+ organisation:
+ meeting_inbox_project_id: "Eingangsprojekt"
person:
user: "Mitglied"
name: "Name"
@@ -389,6 +391,8 @@ de:
forbidden_permission_present: "kann nicht auf nicht-abrechenbar gesetzt werden, solange eine accounts- oder projects-Berechtigung besteht"
organisation:
attributes:
+ meeting_inbox_project_id:
+ not_usable: "muss ein aktives Projekt dieser Organisation sein"
ai_provider:
supported_provider: "muss einer der unterstützten Provider sein"
embedding_dims:
diff --git a/config/locales/models.en.yml b/config/locales/models.en.yml
index fc2b491..52649a5 100644
--- a/config/locales/models.en.yml
+++ b/config/locales/models.en.yml
@@ -2,6 +2,8 @@
en:
activerecord:
attributes:
+ organisation:
+ meeting_inbox_project_id: "Inbox project"
person:
user: "Member"
name: "Name"
@@ -381,6 +383,8 @@ en:
forbidden_permission_present: "cannot be set to non-billable while it has an accounts or projects permission"
organisation:
attributes:
+ meeting_inbox_project_id:
+ not_usable: "must be an active project of this organisation"
ai_provider:
supported_provider: "must be one of the supported providers"
embedding_dims:
diff --git a/db/migrate/20261101100000_add_meeting_inbox_project_to_organisations.rb b/db/migrate/20261101100000_add_meeting_inbox_project_to_organisations.rb
new file mode 100644
index 0000000..64f6eac
--- /dev/null
+++ b/db/migrate/20261101100000_add_meeting_inbox_project_to_organisations.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+# The project a meeting lands in when a client sends one without a project.
+# Nullable: an organisation chooses one or has none. on_delete nullify, so a
+# deleted project clears the choice in every delete path, the one that takes a
+# whole organisation along included. An archived project keeps the column and
+# counts as not set (Organisation#meeting_inbox), so restoring it brings the
+# inbox back.
+class AddMeetingInboxProjectToOrganisations < ActiveRecord::Migration[8.1]
+ def change
+ add_reference :organisations, :meeting_inbox_project, type: :uuid,
+ foreign_key: { to_table: :projects, on_delete: :nullify }
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 7ab338e..25795ff 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema[8.1].define(version: 2026_10_29_150000) do
+ActiveRecord::Schema[8.1].define(version: 2026_11_01_100000) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_catalog.plpgsql"
enable_extension "pgcrypto"
@@ -1023,10 +1023,12 @@ ActiveRecord::Schema[8.1].define(version: 2026_10_29_150000) do
t.boolean "data_import_enabled", default: false, null: false
t.boolean "assistant_enabled", default: false, null: false
t.boolean "code_indexing_enabled", default: false, null: false
+ t.uuid "meeting_inbox_project_id"
t.index ["account_id"], name: "index_organisations_on_account_id"
t.index ["ai_activated_by_id"], name: "index_organisations_on_ai_activated_by_id"
t.index ["ai_package_id"], name: "index_organisations_on_ai_package_id"
t.index ["ai_provider"], name: "index_organisations_on_ai_provider"
+ t.index ["meeting_inbox_project_id"], name: "index_organisations_on_meeting_inbox_project_id"
t.index ["notification_sender_email"], name: "index_organisations_on_notification_sender_email"
end
@@ -2096,6 +2098,7 @@ ActiveRecord::Schema[8.1].define(version: 2026_10_29_150000) do
add_foreign_key "organisations", "accounts"
add_foreign_key "organisations", "ai_packages"
add_foreign_key "organisations", "embedding_spaces", column: "active_embedding_space_id", on_delete: :nullify
+ add_foreign_key "organisations", "projects", column: "meeting_inbox_project_id", on_delete: :nullify
add_foreign_key "organisations", "users", column: "ai_activated_by_id", on_delete: :nullify
add_foreign_key "organisations", "users", column: "ai_package_selected_by_id", on_delete: :nullify
add_foreign_key "outbox_events", "activities"
diff --git a/spec/models/organisation_meeting_inbox_spec.rb b/spec/models/organisation_meeting_inbox_spec.rb
new file mode 100644
index 0000000..adc12f6
--- /dev/null
+++ b/spec/models/organisation_meeting_inbox_spec.rb
@@ -0,0 +1,66 @@
+# frozen_string_literal: true
+
+require 'rails_helper'
+
+# What: the inbox project of an organisation. #meeting_inbox is the one reader;
+# an archived project counts as not set and comes back on restore.
+# Why: the column alone does not say whether a project still takes meetings, and
+# a client that writes into an archived project would land where nobody looks.
+RSpec.describe Organisation, type: :model do
+ let(:organisation) { create(:organisation) }
+ let(:user) { create(:user) }
+ let(:project) { create(:project, organisation: organisation) }
+
+ before { ActsAsTenant.current_tenant = organisation }
+
+ it 'has no inbox until one is chosen' do
+ expect(organisation.meeting_inbox).to be_nil
+ expect(project.meeting_inbox?).to be(false)
+ end
+
+ it 'answers the chosen project, and only that one is the inbox' do
+ other = create(:project, organisation: organisation)
+ organisation.update!(meeting_inbox_project: project)
+
+ expect(organisation.meeting_inbox).to eq(project)
+ expect(project.reload.meeting_inbox?).to be(true)
+ expect(other.reload.meeting_inbox?).to be(false)
+ end
+
+ it 'treats an archived inbox as not set and brings it back on restore' do
+ organisation.update!(meeting_inbox_project: project)
+
+ project.archive!(user)
+ expect(organisation.reload.meeting_inbox).to be_nil
+ expect(organisation.meeting_inbox_project_id).to eq(project.id)
+ expect(project.reload.meeting_inbox?).to be(false)
+
+ project.unarchive!
+ expect(organisation.reload.meeting_inbox).to eq(project)
+ end
+
+ it 'refuses a project of another organisation' do
+ foreign = ActsAsTenant.without_tenant { create(:project, organisation: create(:organisation)) }
+ organisation.meeting_inbox_project_id = foreign.id
+
+ expect(organisation).not_to be_valid
+ expect(organisation.errors.of_kind?(:meeting_inbox_project_id, :not_usable)).to be(true)
+ end
+
+ it 'refuses an archived project when it is chosen, not on every later save' do
+ organisation.update!(meeting_inbox_project: project)
+ project.archive!(user)
+ expect(organisation.reload.update(name: 'Neuer Name')).to be(true)
+
+ archived = create(:project, organisation: organisation, archived_at: 1.day.ago)
+ organisation.meeting_inbox_project_id = archived.id
+ expect(organisation).not_to be_valid
+ end
+
+ it 'clears the column when the project is deleted' do
+ organisation.update!(meeting_inbox_project: project)
+ project.destroy!
+
+ expect(organisation.reload.meeting_inbox_project_id).to be_nil
+ end
+end
diff --git a/spec/requests/organisations/organisation_settings_spec.rb b/spec/requests/organisations/organisation_settings_spec.rb
index b7704a6..eee8f3d 100644
--- a/spec/requests/organisations/organisation_settings_spec.rb
+++ b/spec/requests/organisations/organisation_settings_spec.rb
@@ -86,4 +86,60 @@ RSpec.describe 'Organisations::OrganisationSettings', type: :request do
end
end
end
+
+ describe 'the inbox project' do
+ let!(:project) { create(:project, organisation: organisation, name: 'Eingangskorb') }
+ let!(:archived) { create(:project, organisation: organisation, name: 'Altbestand', archived_at: 1.day.ago) }
+
+ before { sign_in admin }
+
+ it 'sets and clears the project' do
+ patch organisation_settings_path(organisation), params: { organisation: { meeting_inbox_project_id: project.id } }
+ expect(organisation.reload.meeting_inbox).to eq(project)
+
+ patch organisation_settings_path(organisation), params: { organisation: { meeting_inbox_project_id: '' } }
+ expect(organisation.reload.meeting_inbox_project_id).to be_nil
+ end
+
+ it 'refuses a project of another organisation and stores nothing' do
+ foreign = ActsAsTenant.without_tenant { create(:project, organisation: create(:organisation)) }
+
+ patch organisation_settings_path(organisation), params: { organisation: { meeting_inbox_project_id: foreign.id } }
+
+ expect(response).to have_http_status(:unprocessable_content)
+ expect(organisation.reload.meeting_inbox_project_id).to be_nil
+ end
+
+ it 'refuses an archived project and stores nothing' do
+ patch organisation_settings_path(organisation), params: { organisation: { meeting_inbox_project_id: archived.id } }
+
+ expect(response).to have_http_status(:unprocessable_content)
+ expect(organisation.reload.meeting_inbox_project_id).to be_nil
+ end
+
+ it 'keeps an inbox archived meanwhile when the form is saved with it, and says so' do
+ organisation.update!(meeting_inbox_project: project)
+ project.archive!(admin)
+
+ get organisation_settings_path(organisation)
+ expect(response.body).to include(I18n.t('organisations.organisation_settings.show.meeting_inbox_archived_hint'))
+ expect(response.body).to include(I18n.t('organisations.organisation_settings.show.meeting_inbox_archived_option', name: project.name))
+
+ patch organisation_settings_path(organisation), params: { organisation: { name: 'Neu', meeting_inbox_project_id: project.id } }
+ expect(organisation.reload.meeting_inbox_project_id).to eq(project.id)
+ end
+
+ it 'marks the inbox on its dashboard and no other project there' do
+ organisation.update!(meeting_inbox_project: project)
+ other = create(:project, organisation: organisation, name: 'Anderes')
+ subtitle = I18n.t('organisations.projects.show.meeting_inbox_subtitle', name: project.name)
+
+ get organisation_project_path(organisation, project)
+ expect(response.body).to include(CGI.escapeHTML(subtitle))
+ expect(response.body).to include(%(aria-label="#{I18n.t('navigation.meeting_inbox')}"))
+
+ get organisation_project_path(organisation, other)
+ expect(response.body).not_to include(CGI.escapeHTML(subtitle))
+ end
+ end
end