Commit Graph
13 Commits
Author SHA1 Message Date
rickyandClaude Opus 5.5 d8cd462194 Configurable roles: Owner, Mechanic, Pilot, Viewer and custom roles
What people can do on an aircraft now comes from their role there, and
administrators set what each role allows (Admin → Roles).

- Roles are installation-wide sets of permissions (31, grouped as flying,
  squawks and notes, maintenance records, imports and exports, the
  aircraft, notifications). Seeing an aircraft's records needs none.
- Built in: Owner (always every permission, so an aircraft can always be
  managed), Mechanic (shop maintenance: logbook, signing, components,
  inspections, ADs, squawks, reminders), Pilot (what pilots could do
  before) and Viewer (view only). Administrators can change all but
  Owner's, and add their own; a role can be deleted once nobody has it.
- Existing owners and pilots keep exactly what they could do.
- Admin → Users → a user lists their role on every aircraft, to change,
  remove or add. On the aircraft's Access page, anyone who manages people
  hands out roles, but only an Owner can give or take away Owner, nobody
  changes their own (except administrators), and an aircraft always
  keeps an Owner (AircraftAccess).
- Controllers declare the permission each action needs; a request that
  changes something with none declared is refused (and raises in
  development and tests), and a test walks every route to check.
- Weekly reminders and overdue alerts go to roles that get reminders;
  the DRS reminder also needs Manage ADs. The API follows the person's
  role; its owners_only error is now not_permitted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 17:43:38 -05:00
rickyandClaude Opus 5.5 d2cd60c6a7 Flights can be corrected after they're saved
- Edit on a flight: owners can correct any flight; a pilot, the flights
  they logged (the same rule as its engine data).
- Date, airports, route, notes, oil and fuel (its oil and fuel records
  follow) and the attached files can always be changed.
- The meter readings only on the latest flight, while its tach in is
  still the aircraft's tach: the aircraft and installed components move
  by the difference, and with both readings the duration is worked out
  from them. On earlier flights they're locked (later flights started
  from them), pointing to Update Hours; the server ignores them too.
- Each correction is in the activity log with what changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 17:12:05 -05:00
rickyandClaude Opus 5.5 03b9ad65cb Workflow polish: setup checklist, next leg, grouped component limits
- Setup checklist on a new aircraft's Overview (owners): components,
  standard inspections, DRS AD import, registration/airworthiness
  certificate, weight and balance; hideable per device
- Log Flight: "Save and log next leg" reopens the form on the same date,
  starting where the leg ended
- Component form: limits in two collapsible groups (replacement and expiry;
  overhaul and TBO), open when in use
- Squawk form warns what "Ground Aircraft" does
- Logbook entry form: inspection result only for inspection entries
  (show-when controller); document names default from the file
- Dates in pickers, the activity log, airworthiness lines, search, audits
  and transcription notes use the app format
- No duplicate Report Squawk button on Squawks; "Record service" label

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 07:43:03 -05:00
rickyandClaude Opus 5.5 89ed0a76f9 Move all user-facing text into config/locales/en.yml for localization
- Views use lazy t(".key") lookups; sentences with values or links stay
  whole (interpolation, _html keys); counts use one/other plurals
- Stored-value labels (statuses, types, priorities...) are LabelSets read
  from labels: in the current locale; field names and validation messages
  under activerecord:; flash and activity text under flash:
- Services, models, helpers, mailer subjects, the logbook PDF, procedures
  templates, records package README and transcription warnings localized;
  the PDF reuses LogbookEntry#certification_statement instead of a copy
- Scripts read js: strings from a JSON tag via app/javascript/i18n.js
- Dates through I18n.l (app, weekday, month_year, long formats); html lang
  follows the locale
- APP_LOCALE picks the language (falls back to English); missing
  translations raise in development and tests
- README: Translating section and APP_LOCALE

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 22:08:20 -05:00
rickyandClaude Opus 5.5 191eb030e8 Log flights offline: the form is kept by the service worker, flights queue on the device (IndexedDB) and send when back online; one-time keys prevent duplicates
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 21:13:59 -05:00
rickyandClaude Opus 5.5 455a26a346 Flights tab: load the flight log 30 days at a time, the rest as you scroll (lazy Turbo frames)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 20:22:02 -05:00
rickyandClaude Opus 5.5 7dbf180f76 Flights tab: flight log grouped by day (route chain, tach/Hobbs/fuel/oil totals), expand for the legs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 18:44:11 -05:00
rickyandClaude Opus 5.5 2d068e1a63 Interactive engine data charts: click to zoom, crosshair readout, range stats
Clicking a chart opens a viewer with higher-resolution data (new JSON
endpoint, fetched once): drag to zoom, tabs keep the zoom across metrics,
legend toggles, and min/avg/max for the visible range in monitor time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 17:42:24 -05:00
rickyandClaude Opus 5.5 6c6e7af8e6 Add engine monitor data (CGR-30P/CGR-30C) to flight logs
Attach a CGR-30 flight recording when logging a flight or later from the
flight page. The flight page shows engine run time, fuel burned, tach and
engine hours, peak RPM/EGT/CHT/oil/fuel flow, and charts per cylinder.
Unreadable files are rejected; recordings from another tail are flagged.

Also replace the real tail number in test data with N12345.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 20:25:18 -05:00
rickyandClaude Opus 5.5 86aadfcf6c Add dark mode; align table headers with numeric columns
Dark mode:
- Theme toggle in the header (System → Light → Dark); "System" follows
  the OS setting and its changes. The choice is kept per browser and
  applied before first paint, so there's no light flash.
- Implemented by remapping the palette under :root[data-theme=dark]:
  grays flip, color tints become translucent, dark colored text becomes
  its light counterpart. Page, surface, header and accent colors are
  semantic tokens. Native controls follow via color-scheme.
- Chart text and grid colors follow the theme.
- Public share pages get the toggle too.
- Contrast checked against WCAG 4.5:1 (primary button text and error
  text adjusted for dark).

Tables:
- Shared table style no longer forces header text left, so right-aligned
  numeric headers line up with their columns everywhere.
- Flight log: units in headers, muted dashes for empty cells, GPS marker
  beside the route instead of its own column.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 19:53:11 -05:00
rickyandClaude Opus 5.5 5bf682502b AirTrail sync and export, GPS tracks, airport database with autocomplete
AirTrail (https://github.com/johanohly/AirTrail):
- File export (Flights → Export for AirTrail) in AirTrail's import
  format, validated against its schema; same-day repeat legs get leg
  numbers so AirTrail's de-duplication doesn't merge them.
- Automatic sync through AirTrail's REST API (Profile → AirTrail sync):
  per-user connection with an encrypted API key and scope check; flights
  are created/updated/deleted in background jobs; a full sync first
  links flights already in AirTrail (e.g. from a file import) instead of
  duplicating them; airports are resolved and cached, with manual
  mapping for unknown codes.
- GPS tracks: GPX, KML and CSV track logs are converted to AirTrail's
  track format for both sync and export; the flight page shows a summary.
- Aircraft ICAO type (e.g. C150) for AirTrail's aircraft type.

Airport database (OurAirports, the source AirTrail uses):
- Managed like AirTrail: downloaded in the background on first start,
  updated in place from Admin → Airports (adds, changes, removes; ids
  stable), with admin-managed custom airports that updates never touch.
- Each airport carries AirTrail's code, so logged codes translate to
  AirTrail's exactly (1B9 → K1B9, 4MB → K5M3).
- From/To autocomplete on new flights (airports this aircraft has used
  rank first); From is pre-filled with the last flight's destination;
  codes are normalized to uppercase.
- Flights → Standardize airport codes: rewrite logged codes to the
  standard code, and fix codes not in the database (typos such as 0R8 →
  08R are suggested).

Also: admin pages grouped under an Admin dropdown menu.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 19:40:20 -05:00
rickyandClaude Opus 5.5 0c4803d717 Add flying stats to the Flights tab; drop the DRS search link setting
Flights tab:
- Summary cards for the past 30 days, this year, past 12 months and
  since the first flight (flight hours, flights, tach, fuel).
- Flight hours by month (last 24 months) with the past-year monthly
  average, totals (flights, flight/tach time, average and longest
  flight, fuel, gal/hr, airports visited, most visited) and a by-year
  table.
- Flight time is Hobbs time where recorded, otherwise tach time.

Removed the per-aircraft DRS search link and its "Open in DRS" button:
each AD's DRS link already comes from the Excel import. A guarded
migration drops the column.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 18:52:00 -05:00
rickyandClaude Opus 5.5 38df19c331 Initial commit: Rails port of Simple Aircraft Manager
Rails 8.1 + SQLite rewrite of marbindrakon/simple-aircraft-manager,
designed to self-host as a single container (Solid Queue/Cache/Cable,
Active Storage on disk, Hotwire + importmap, Tailwind).

- Airworthiness engine ported from health/services.py (ADs, grounding
  squawks, inspection recurrency, component replacement)
- Hours updates and flight logs cascading to in-service components,
  optional airworthiness enforcement
- Components, squawks, ADs, inspections, logbook, documents, major
  records, oil/fuel consumption stats and charts, activity log
- Admin/owner/pilot RBAC and public share links (status/maintenance)
- Docker Compose and Kamal deployment, env-driven production config
- Service and integration tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 17:59:08 -05:00