Commit Graph
27 Commits
Author SHA1 Message Date
n0tst3v3andClaude Opus 5 308d63b8d8 feat(map): upload recorded sightings to the ingestion server
Adds ServerUploader plus an "Upload to Server" button and a Server…
settings dialog in the map filter panel.

The uploader builds a CSV of every device fix and every recorded history
point - the history rows are the interesting ones, since they carry each
device's location trail - and POSTs it as multipart/form-data with the API
key in X-API-Key. Timestamps are written ISO-8601 in UTC, because sending
local time would shift every point by the phone's offset.

It uploads the whole database every time rather than tracking what was sent
before. The server deduplicates on (mac, timestamp, latitude, longitude), so
re-sending is idempotent: anything it already holds comes back counted as a
duplicate instead of stored twice. Keeping the client dumb is what makes a
failed or partial upload safe to simply retry, with no sync state to get out
of step.

Network work runs on a background thread and the result is delivered on the
main thread; the button disables itself while a run is in flight and the
panel shows the returned metrics.

The URL and key default to the deployment at bt.justbug.me and are editable
in the dialog, stored in the server_settings preferences.

Verified against the real server: the exact CSV this emits - including empty
RSSI cells for history rows and a device name containing a comma - ingests as
4 points, and re-uploading the same file returns 4 duplicates and 0 added.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-19 11:26:29 -06:00
n0tst3v3andClaude Opus 5 6808e88599 feat(map): use Font Awesome link icons for the point events
Swaps the emoji for Font Awesome Free 6.5.2 "link" and "link-slash"
(solid), inlined as SVG paths instead of loaded from a CDN. Pulling
the icon font would be a ~75KB network download for two glyphs, and
the popups need to render whether or not that request succeeds.

Inline SVG also takes a fill colour, so connected draws green and
dropped draws red, and it renders identically regardless of the
device's emoji font - 💔 was a stand-in because the literal broken
chain (U+26D3 U+FE0F U+200D U+1F4A5) is a 2023 addition that shows
as a blank box on older Android.

Both paths verified byte-for-byte against upstream.

Icons: CC BY 4.0, Copyright 2024 Fonticons, Inc.
https://fontawesome.com/license/free

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-19 10:48:48 -06:00
n0tst3v3andClaude Opus 5 f16efce66e perf(scanner): stop redoing everything on every advertisement, plus map point events
Yes, the scanner was duplicating. refreshCategoryOptions(),
updateRadar() and pairedAdapter.notifyDataSetChanged() ran from
acceptSignal on every advertisement AND from pruneTask once a second
- the same three calls either way.

Worse, the whole persist path ran per advertisement, and ScanCallback
is delivered on the main looper: a hex dump of the advertisement,
lookupCompany(), get(), lookupOui(), then telemetry(),
setDetectedCategory(), recordObservation() and setVendor(). Eight
database operations on the UI thread per beacon, at
SCAN_MODE_LOW_LATENCY, times every transmitter in range. The radar
sweep re-posts itself every 33ms and was competing for that thread,
which is why it dragged.

A device already on the radar now only gets its RSSI and last-seen
stamp refreshed until PERSIST_INTERVAL_MS (3s) is up. A device's
first sighting still takes the full path and refreshes at once.

The radar view also allocated per frame at 30fps: a six-stop
RadialGradient plus two arrays, and a fresh ArrayList and Comparator
for the target sort. Both reused now. setTargets no longer
invalidates while scanning, since onDraw already re-posts itself.
Left setLayerType(SOFTWARE) alone - setShadowLayer only works on text
under hardware acceleration, so removing it would drop the ring glow.

Separately, history points now say why they exist. location_history
had no event column, so schema 16 adds one; connected() and
disconnected() stamp it and a plain position refresh leaves it null.
The popup shows a linked or broken-link line for the two states and
stays quiet for older rows that predate the column.

History points also render as the device's own marker at half size
rather than a plain circle, sharing one divIcon per device so a long
trail does not build a DOM node per point.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-19 10:27:15 -06:00
n0tst3v3andClaude Opus 5 0f01b836c6 fix(map): un-clip the date buttons, link every popup's coordinates
Date/time buttons carry a two-line label ("From\nAug 19, 2026") but
sat in a fixed dp(40) row, so the date line was cut off and only
From/To was readable. My own compaction pass tightened that row from
48dp to 40dp and made it worse. They now measure wrap-content, at
11sp, with all-caps off (Buttons upper-case by default, which is
what pushed the date past the edge) and 4dp side padding instead of
the stock ~16dp.

Historical, normalized and removed points now render their
coordinates as the same tappable geo: link the live device popup
already used - MapActivity's WebViewClient hands geo: to the maps
app, so all four popups behave the same. Factored into gpsLink().

Drops the "View: Normalized" line from the device popup; the filter
panel already says which view is active.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-19 09:39:38 -06:00
n0tst3v3andClaude Opus 5 be517f56a5 fix(map): bring back the compact filter button and floating layers control
The split carried over the wrong versions of two bits of chrome.

The filter toggle had become a full-width grey TextView bar, 48dp of
"Map Filters ▼" sitting above the map. Restored to what it was: a
small "☰  Filters" button on a wrap-content row.

The Leaflet layers control was being created with collapsed:false,
which pins the whole Streets/Satellite list open as a box over the
map. collapsed:true is what renders it as the floating corner button
that opens on tap. Its 13px font rule came back with it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-19 09:30:45 -06:00
n0tst3v3andClaude Opus 5 655b01be50 fix(map): make the filter panel scroll, and tighten it up
The panel is taller than a phone screen, and it was a LinearLayout
child with WRAP_CONTENT and no weight - so the excess was simply
clipped at the bottom edge. Everything from the accuracy multiplier
down was unreachable, which is where Apply, Reset, Export Raw and
Export Normalized had gone. Nothing was missing from the build; it
was drawn off-screen.

Wrap it in a ScrollView carrying the layout weight, so it shares the
screen with the map and scrolls to the rest. setFiltersExpanded now
hides the scroller rather than the panel inside it, or the collapsed
state would leave an empty scroller holding half the screen.

Then cut roughly 145dp of height out of the panel so most of it fits
without scrolling at all: the threshold readout goes from five lines
to two, the normalization summary from six to two (the level and
percentage are already on the line above it), button rows 48dp ->
40dp, the slider 42dp -> 28dp, and the section labels and paddings
lose a few dp each.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-19 09:27:12 -06:00
n0tst3v3andClaude Opus 5 5d98f474ae fix(live): stop the item pin from tracking the bearing arrow
The pin sat dead ahead of the heading arrow no matter which way the
user turned, so the arrow looked like it was aiming at the item and
the item looked like it was always straight down the path of travel.

The cause is geometric, not a UI link. addSample() only accepts a
sample after 5 m of movement, so every sample lies on the line the
user walked. gradientBearing() correlates RSSI against centred
position, and on a collinear track each centred position is t*u for
a single unit vector u along the walk - so the sum is exactly
parallel to u regardless of the signal. The "estimated" bearing was
the direction of travel, echoed back.

That bearing then placed the pin in three separate paths:
preliminaryEstimate() projects along it, solve() overrides a
converged trilateration with it, and consensusEstimate() averages
the result. All three produced a pin straight ahead.

Refuse the bearing until the track has real width across its own
axis - the smaller eigenvalue of the position covariance, against
max(4 m, meanAccuracy/2). A straight walk with GPS jitter measures
about 1 m of spread and is rejected; an L of two 20 m legs measures
about 5 m and is accepted. Distances still place the item off-axis
on a straight walk, but which side is a real mirror ambiguity, so
the UI now says so and asks for a leg at 90 degrees instead of
inventing a side.

Also drops showFallbackPin(), which projected the pin along the raw
compass heading whenever no estimate was solved - a fourth route to
the same wrong place. With no estimate the pin now shows the item's
last known GPS fix, or nothing at all.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-19 09:10:26 -06:00
n0tst3v3andClaude Opus 5 15baafc9be refactor(map): split the map screen into four focused classes
MapActivity had grown to 4,800 lines and was editing itself into
corruption - the field block had picked up seventeen duplicate
declarations of showNormalizationChanges, and that name was being
used for both the CheckBox widget and the boolean state it toggles,
which is what the compiler was actually failing on.

Fix the collision the way the class already handles the same pattern
elsewhere (showNormalized/normalizedMode): the widget is showChanges,
the state stays showNormalizationChanges.

Then move the bulk out of the activity:

  HistoryNormalizer  the GPS cleanup engine, its caches, thresholds
                     and the LocationPoint reflection helpers
  MapExporter        CSV export, including the 695-line writer and
                     the file-picker round trip
  MapHtmlBuilder     the Leaflet page, markers, trails and popups
  MapFormat          date/reason/colour/HTML/JS/CSV escaping shared
                     by all three

The activity keeps the UI - onCreate, the filter panel, pickers and
sensors - and feeds the builders through a Filters snapshot, an
Options struct and a two-method DataSource interface, so none of the
extracted classes reach back into its widgets.

Behaviour is unchanged. Also drops pendingExportMode, which was
written in two places and never read.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-19 04:56:19 -06:00
n0tst3v3 00703e013c fix(live): restore the moving navigation pin, aimed at the signal gradient 2026-08-19 04:01:30 -06:00
n0tst3v3 57861a19c6 fix: restore AIDE build config and layer live find map correctly 2026-08-19 03:50:02 -06:00
n0tst3v3 feb32c9cd1 fix(ui): support foldables and large screens instead of running in compat mode 2026-08-19 03:32:34 -06:00
n0tst3v3 340a32c301 fix(live): point the heading arrow at true north and keep the phone marker on top 2026-08-19 03:13:43 -06:00
n0tst3v3 f711e5ee36 build: modernize Gradle to AGP 8.5 with wrapper and namespace 2026-08-19 03:13:43 -06:00
n0tst3v3 48b40136cf fix: restore NavigationHelper.java clobbered by a pasted Python script 2026-08-19 02:26:16 -06:00
n0tst3v3 564877e1e7 fix(map): make filter panel compact and scrollable 2026-08-19 00:57:05 -06:00
n0tst3v3 8d3d571954 feat(alerts): keep alerting until left-behind items are acknowledged 2026-08-19 00:57:05 -06:00
n0tst3v3 a48cc91680 feat(list): sort tracked items by last seen with reverse toggle 2026-08-19 00:56:47 -06:00
n0tst3v3 a5f5d415e2 feat(map): add GPS point downsampling and UI density control 2026-08-19 00:56:47 -06:00
n0tst3v3 a2c74dc52f chore(map): add missing package declaration to MapActivity 2026-08-19 00:56:38 -06:00
n0tst3v3 2ced76049b Revert "fix(map): make filter panel compact and scrollable"
This reverts commit dc63fffb67.
2026-08-19 00:54:47 -06:00
n0tst3v3 dc63fffb67 fix(map): make filter panel compact and scrollable 2026-08-19 00:50:25 -06:00
n0tst3v3 d5150ba126 Revert "feat(map): add GPS point downsampling and UI density control"
This reverts commit c15dd28f3b.
2026-08-19 00:49:20 -06:00
n0tst3v3 b8401b3613 Revert "feat(ui): update item sorting, persistent notifications, and compact map sampling UI"
This reverts commit ca3aaaf163.
2026-08-19 00:49:20 -06:00
n0tst3v3 ca3aaaf163 feat(ui): update item sorting, persistent notifications, and compact map sampling UI 2026-08-19 00:18:43 -06:00
n0tst3v3 c15dd28f3b feat(map): add GPS point downsampling and UI density control 2026-08-18 23:57:46 -06:00
MAragon ffac2efd22 Update Bluetooth logger files 2026-08-18 18:52:29 -06:00
MAragon eb16dbaeac Initial commit 2026-08-16 22:52:52 -06:00