From 871f9bb3ecf586695caa007a7e20e077ecf54b2d Mon Sep 17 00:00:00 2001 From: Marcelo Paiva Date: Wed, 25 Feb 2026 23:05:14 -0500 Subject: [PATCH] Fix skip-to-main-content link: focusable targets, plain layout - Add tabindex="-1" to #scrollbox in submit_form/show so focus lands there after skip link activation (not just scroll position) - Add skip link to plain layout (used by submissions/show) - Add id="main-content" tabindex="-1" to submissions/show outer div as the skip link target Co-Authored-By: Claude Sonnet 4.6 --- app/views/layouts/plain.html.erb | 3 ++ app/views/submissions/show.html.erb | 62 +++++++++++++++-------------- app/views/submit_form/show.html.erb | 4 +- 3 files changed, 38 insertions(+), 31 deletions(-) diff --git a/app/views/layouts/plain.html.erb b/app/views/layouts/plain.html.erb index 88916977..2ce9467b 100644 --- a/app/views/layouts/plain.html.erb +++ b/app/views/layouts/plain.html.erb @@ -13,6 +13,9 @@ <%= stylesheet_pack_tag 'application', media: 'all' %> + + Skip to main content + <% if flash.present? %><%= render 'shared/flash' %><% end %> <%= yield %> diff --git a/app/views/submissions/show.html.erb b/app/views/submissions/show.html.erb index 51879660..be9c1691 100644 --- a/app/views/submissions/show.html.erb +++ b/app/views/submissions/show.html.erb @@ -7,7 +7,7 @@ <% is_combined_enabled = configs.find { |e| e.key == AccountConfig::COMBINE_PDF_RESULT_KEY }&.value == true && !@submission.template_fields&.any? { |f| f['type'] == 'verification' } %> <% with_submitter_timezone = configs.find { |e| e.key == AccountConfig::WITH_SUBMITTER_TIMEZONE_KEY }&.value == true %> <% with_signature_id_reason = configs.find { |e| e.key == AccountConfig::WITH_SIGNATURE_ID_REASON_KEY }&.value != false %> -
+
-
- <% has_full_text = schema.all? do |item| - doc = @submission.schema_documents.find { |a| a.uuid == item['attachment_uuid'] } - n_pages = doc.metadata.dig('pdf', 'number_of_pages').to_i - pages_text = doc.blob.metadata.dig('pdf', 'pages_text') || {} - n_pages > 0 && pages_text.size >= n_pages - end %> - <% if has_full_text %> - -
- - -
+ <% has_full_text = schema.all? do |item| + doc = @submission.schema_documents.find { |a| a.uuid == item['attachment_uuid'] } + n_pages = doc.metadata.dig('pdf', 'number_of_pages').to_i + pages_text = doc.blob.metadata.dig('pdf', 'pages_text') || {} + n_pages > 0 && pages_text.size >= n_pages + end %> + <% if has_full_text %> + +
+ + +
+
- <% end %> + <% else %> +
+ <% end %>
<% fields_index = Templates.build_field_areas_index(@submission.template_fields || @submission.template.fields) %> <% submitters_index = @submission.submitters.index_by(&:uuid) %> <% submitters_order_index = nil %> - <% attachments_index = ActiveStorage::Attachment.where(record: @submission.submitters, name: :attachments).preload(:blob).index_by(&:uuid) %> + <% attachments_index = ActiveStorage::Attachment.where(record: @submission.submitters, name: :attachments).index_by(&:uuid) %> <% page_blob_struct = Struct.new(:url, :metadata, keyword_init: true) %> <% bg_classes = %w[bg-red-100 bg-sky-100 bg-emerald-100 bg-yellow-100 bg-purple-100 bg-pink-100 bg-cyan-100 bg-orange-100 bg-lime-100 bg-indigo-100] %> <% schema.each do |item| %> @@ -170,7 +172,7 @@ <% end %> <% end %>
- <% if has_full_text %> + <% if has_full_text %>
- - <% end %> -
+
+
+ <% else %> +
+ <% end %>