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.

fix(people): keep the empty lane closed on a list visit

Guido Boyke6c598521d5a4
diff --git a/app/views/organisations/people/_lane.html.erb b/app/views/organisations/people/_lane.html.erb
index 152c20f..628ba6e 100644
--- a/app/views/organisations/people/_lane.html.erb
+++ b/app/views/organisations/people/_lane.html.erb
@@ -1,8 +1,10 @@
<%# locals: (state:, person: nil, member: nil, message: nil) %>
<%# What the lane frame holds: a person row (:detail), a member without a row
(:member), the form (:form, new or edit), or nothing yet (:empty).
- Rendered by the index on a full visit and alone for a frame request. %>
-<div class="person-content people-lane min-w-0 relative">
+ Rendered by the index on a full visit and alone for a frame request.
+ person-content marks LOADED content for layout-toggle and index-page; the
+ empty lane must not carry it, or they open an empty column. %>
+<div class="<%= 'person-content' unless state == :empty %> people-lane min-w-0 relative">
<% if state == :detail %>
<%= render 'organisations/people/detail', person: person %>
<% elsif state == :member %>
diff --git a/spec/requests/organisations/people_spec.rb b/spec/requests/organisations/people_spec.rb
index 4b07266..7670e2d 100644
--- a/spec/requests/organisations/people_spec.rb
+++ b/spec/requests/organisations/people_spec.rb
@@ -731,6 +731,19 @@ RSpec.describe 'Organisations::People', :ci_guard, type: :request do
expect(row).to include(CGI.escapeHTML('keydown.enter->list-row#click'), CGI.escapeHTML('keydown.space->list-row#click'))
end
+ # Review of db1b0288a: the empty lane carried the content marker, so
+ # layout-toggle took it for loaded and opened an empty column on every list
+ # visit and after a delete.
+ it 'renders no content marker in the empty lane, only with something open' do
+ sign_in admin
+
+ get organisation_people_path(organisation)
+ expect(response.body).not_to match(/class="person-content/)
+
+ get organisation_people_path(organisation, person_id: person.id)
+ expect(response.body).to match(/class="person-content/)
+ end
+
it 'has no missing translation on the page' do
sign_in admin
get organisation_people_path(organisation, person_id: person.id)