Blackstone oil analysis, .sam.zip export/import, AI logbook transcription

- Oil analysis: Blackstone PDF import (20 elements, oil properties, universal
  averages), results stored per element, oil type, "leave out of trends",
  the original app's statuses; AvLab fixes (multi-line comments, unrelated
  labels no longer steal values). Existing records migrate.
- Aircraft archives in the original app's .sam.zip format (schema v2): export
  from Access & Sharing, background import from the Fleet page, rake tasks.
  Archives move both ways between this app and the original.
- Scanned logbook pages (images or PDFs) upload as a document; with
  ANTHROPIC_API_KEY set, Claude transcribes them into logbook entries.
- Fix: deleting a component or aircraft failed when AD compliances or
  inspection records pointed at a component.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-06 21:05:19 -05:00
1 parent 2d068e1a63
commit 1c6c2f88c0
54 files changed
+2794 -286

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
<% content_for :title, "Aircraft Import" %>
<% if @import.in_progress? %><% content_for :head, tag.meta("http-equiv": "refresh", content: "2") %><% end %>
<div class="mx-auto max-w-2xl space-y-5">
<h1 class="text-2xl font-bold tracking-tight">Importing <%= @import.tail_number %></h1>
<section class="card card-body space-y-3 text-sm" id="import-status">
<p class="text-slate-500"><%= @import.filename %><%= " · from #{@import.source}" if @import.source.present? %></p>
<% if @import.in_progress? %>
<p class="flex items-center gap-2 font-medium"><span class="inline-block h-3 w-3 animate-pulse rounded-full bg-sky-500"></span>
<%= @import.status == "queued" ? "Waiting to start…" : "Importing…" %></p>
<% if @import.counts.any? %><p class="text-slate-600">So far: <%= @import.summary %>.</p><% end %>
<p class="hint">This page updates by itself. Large archives with many documents can take a few minutes.</p>
<% elsif @import.done? %>
<p class="font-medium text-emerald-700">Imported.</p>
<p class="text-slate-600"><%= @import.summary.presence&.upcase_first || "No records" %>.</p>
<% if @import.aircraft %><p><%= link_to "Open #{@import.aircraft.tail_number} →", aircraft_path(@import.aircraft), class: "btn-primary" %></p><% end %>
<% else %>
<p class="font-medium text-red-700">The import failed. Nothing was added.</p>
<p class="text-slate-600"><%= @import.error %></p>
<p><%= link_to "Try another file", new_aircraft_import_path, class: "btn-secondary" %></p>
<% end %>
<% if @import.warnings.any? %>
<div class="border-t border-slate-100 pt-3">
<p class="mb-1 text-xs font-semibold text-slate-500"><%= pluralize(@import.warnings.size, "note") %></p>
<ul class="list-disc space-y-0.5 pl-5 text-slate-600"><% @import.warnings.each do |w| %><li><%= w %></li><% end %></ul>
</div>
<% end %>
</section>
</div>