Skip to content

Sectional contrast fix: Added bounding box around each traffic icon for greater visibility (e.g., on sectionals)#3

Merged
apps4av merged 25 commits into
apps4av:masterfrom
shanelenagh:PR_traffic_icons_squashmerge
Mar 30, 2024
Merged

Sectional contrast fix: Added bounding box around each traffic icon for greater visibility (e.g., on sectionals)#3
apps4av merged 25 commits into
apps4av:masterfrom
shanelenagh:PR_traffic_icons_squashmerge

Conversation

@shanelenagh
Copy link
Copy Markdown
Contributor

@shanelenagh shanelenagh commented Mar 22, 2024

Added bounding box and numerous other color tweaks for greater sectional contrast. Also various other icon changes after conversations with Zubair.

…coptor blades to not get clipped as a result), and adjusted shade of green for "low" traffic, both for greater sectional contrast
…ckground (to go with other contrast changes)
…t bounding box, and some comment and form cleanup
…evels") to only 10%, from 20% before, to give sharper contrast on near-flight-level traffic above and below
…ape look less X-Boxy, until a sub is found for it)
…he barb and opacity configurable options (no UI to change at present), and cleaned up several style items (constants, naming, consolidating cache and repaint key, etc.)
@shanelenagh shanelenagh changed the title Sectional contrast fix: Added black bounding box around each traffic icon (had to adjust heli… Sectional contrast fix: Added shadow around each traffic icon (had to adjust heli… Mar 25, 2024
…d off upstream, and used a number that is outside the range of the possible values when they are enabled (the first is an optimization, the second a latent bugfix)
…s I did in the demo I am upping the elevation pixels by 1 (less expensive) to achieve a similarly dramatic shadow effect and provide the best contrast "for the (CPU) buck")
@shanelenagh shanelenagh changed the title Sectional contrast fix: Added shadow around each traffic icon (had to adjust heli… Sectional contrast fix: Added shadow around each traffic icon Mar 25, 2024
@shanelenagh
Copy link
Copy Markdown
Contributor Author

I am done tweaking this, @apps4av , so you can review and merge when you feel comfortable.

@shanelenagh
Copy link
Copy Markdown
Contributor Author

Actually, @apps4av , hold off on this for a bit. I am doing some tests on my phone that are showing a big penalty for the shadow effect--trying to see if it can be reduced, or if we have to go back to another strategy (e.g., the outline and transluscent box this PR started with).

…efaulted to true) vs. shadow drawing option (defaulted to false), due to both performance (severely more expensive) and contrast
…puted once at instantiation, vs. method that computes it afresh every time (the latter being inefficient, since the fields it is based on are final, not to mention the verbosity and overhead of a method call)
@shanelenagh shanelenagh changed the title Sectional contrast fix: Added shadow around each traffic icon Sectional contrast fix: Added bounding box around each traffic icon for greater visibility (e.g., on sectionals) Mar 25, 2024
shanelenagh and others added 8 commits March 25, 2024 19:47
… cherry picked staging lines and it removed it)
…erlay paint if aircraft is flying level); otherwise some comment and format cleanup
…nioned path versions of icons, 2.) added rasterized (pixel) image cache for even greater rendering speed and decreased CPU/GPU load, 3.) comment and style cleanup
@shanelenagh
Copy link
Copy Markdown
Contributor Author

Ok, @apps4av , I am finally done messing with this (per our email discussions). It is ready for your review.

: _aircraftType = _getAircraftIconType(traffic.message.emitter),
_isAirborne = traffic.message.airborne,
_flightLevelDiff = _getGrossFlightLevelDiff(traffic.message.altitude),
_flightLevelDiff = prefAltDiffOpacityGraduation ? _getGrossFlightLevelDiff(traffic.message.altitude) : -999999,
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use infinity instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really wish Dart had some of those constants that Java does (Integer.MAX_VALUE) for things like this, but it doesn't (https://stackoverflow.com/questions/32338554/is-there-an-int-infinity-for-dart). So I picked a value that was well out of the range of what that function could return, due to its nature, and hopefully provides some indication it is a default value to populate a final field. But maybe something that might be better served as an explanatory constant as well (say in the Constants.dart file).

@apps4av apps4av merged commit 31387cb into apps4av:master Mar 30, 2024
apps4av added a commit that referenced this pull request May 26, 2026
Fixes the security audit findings on the v1 Community rules. All
changes are rules-only except a small members-screen tweak so that
non-members of private groups see a friendly message instead of a raw
permission-denied error.

Critical / high:
- Counter updates now require an exact +/-1 delta and forbid negative
  values, instead of allowing any signed-in user to set memberCount
  and postCount to arbitrary numbers (audit #1). Long-term fix is a
  Cloud Function trigger; documented in the rules file.
- All user-writable documents (profile, group, member, post,
  userGroups index) are now whitelisted on field keys and validated
  on types, lengths, and enum values, closing latent privilege
  escalation paths and DoS via oversized documents (audit #2, #4, #8,
  #12, #13).
- Removed the unconstrained isGroupOwner(gid) branch on member create.
  Owner approvals now flow through update of an existing pending doc,
  with status pinned to pending -> active and role/joinedAt frozen
  (audit #3).

Medium:
- Member rosters are no longer enumerable by strangers. Reads of
  groups/{gid}/members require self, owner, public visibility, or
  active membership (audit #6).
- Posts are now bounded to 1000 characters at the rule level (audit
  #7) and to a fixed field whitelist (audit #8).

Hardening:
- isActiveMember consolidated to a single get() lookup pattern via
  helper functions (audit #10 partial).
- All timestamps validated as `is timestamp`; full server-timestamp
  enforcement deferred to a future Cloud Function (audit #13).

Knowingly not fixed in v1 (documented inline):
- Group metadata visibility: the group doc remains readable by any
  signed-in pilot so the Discover tab can surface private groups by
  name. Sensitive future fields must live in a separate restricted
  subcollection (audit #5).
- Counter drift under adversarial use: ruled-bounded to +/-1 per call;
  long-term fix requires Cloud Functions (audit #11).
- Owners can technically self-delete their membership through this
  rule; rules cannot distinguish "owner leaves" from "owner deletes
  group". The client repository blocks owner-leave at call time
  (audit #9).

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants