Skip to content

Vicb/marker - #482

Merged
vicb merged 3 commits into
masterfrom
vicb/marker
Sep 27, 2026
Merged

vicb merged 3 commits into
masterfrom
vicb/marker

Conversation

@vicb

@vicb vicb commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

Summary by Sourcery

Improve marker lifecycle management and tighten component state encapsulation across the application.

Bug Fixes:

  • Ensure 2D markers are detached from the map when their track is cleared or the component disconnects.

Enhancements:

  • Improve marker element lifecycle handling and rendering precision.
  • Encapsulate Lit reactive state across map, tracking, menu, modal, and skyway components.
  • Use direct map event listener cleanup and clarify waypoint name-prefix state.

Chores:

  • Clean up formatting and naming inconsistencies across UI components.

Summary by CodeRabbit

  • Bug Fixes
    • Improved map marker cleanup when tracking is cleared.
    • Corrected point-added event handling for paths.
    • Increased precision for marker sizing and stroke values.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry @vicb, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 20 hours and 51 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

The PR improves Advanced Marker lifecycle handling by retaining the rendered marker reference and cleaning it up when disconnected or its track is cleared, fixes Google Maps listener cleanup, encapsulates Lit reactive state as private, and applies minor naming and formatting cleanup.

Sequence diagram for Advanced Marker lifecycle cleanup

sequenceDiagram
    participant Lit as MarkerElement
    participant Marker as AdvancedMarkerElement
    participant Map as GoogleMap

    Lit->>Marker: ref callback stores marker
    Lit->>Marker: connectedCallback sets map
    alt track cleared while connected
        Lit->>Marker: willUpdate sets map to null
    end
    Lit->>Marker: disconnectedCallback sets map to null
Loading

Sequence diagram for Google Maps listener cleanup

sequenceDiagram
    participant Path as PathElement
    participant Map as GoogleMap
    participant Listener as MapsEventListener

    Path->>Map: addListener(rightclick, appendToPath)
    Map-->>Path: onPointAdded
    Path->>Listener: remove()
    Path->>Listener: remove()
Loading

File-Level Changes

Change Details Files
Retain and manage the rendered Google Maps marker instance explicitly.
  • Capture the advanced marker through Lit’s ref directive.
  • Reuse the captured instance during connection and detach it on disconnection or track removal.
  • Increase marker scale and stroke-width rounding precision.
apps/fxc-front/src/app/components/2d/marker-element.ts
Correct map event listener ownership and cleanup.
  • Rename the point-added listener field.
  • Remove listeners through their MapsEventListener instances with optional chaining.
apps/fxc-front/src/app/components/2d/path-element.ts
Restrict internal reactive component state to private implementation details.
  • Mark Lit state fields private across 2D/3D map components, tracking, menus, and modals.
  • Rename the waypoint prefix state field to clarify its purpose and update template, handler, and download payload references.
apps/fxc-front/src/app/components/2d/skyways-element.ts
apps/fxc-front/src/app/components/2d/tracking-element.ts
apps/fxc-front/src/app/components/3d/marker3d-element.ts
apps/fxc-front/src/app/components/3d/skyways3d-element.ts
apps/fxc-front/src/app/components/ui/main-menu.ts
apps/fxc-front/src/app/components/ui/pref-modal.ts
apps/fxc-front/src/app/components/ui/waypoint-modal.ts
Normalize component formatting and spacing without changing behavior.
  • Remove redundant blank lines around decorated and private fields.
apps/fxc-front/src/app/components/3d/tracking3d-element.ts
apps/fxc-front/src/app/components/ui/share-modal.ts
apps/fxc-front/src/app/components/ui/track-modal.ts
apps/fxc-front/src/app/pages/admin.ts
apps/fxc-front/src/app/pages/archives.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
flyxc-workers c180838 Commit Preview URL

Branch Preview URL
Sep 27 2026, 07:47 PM

@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: aec3b008-b1f3-4688-a3fd-cbd2ef454a45

📥 Commits

Reviewing files that changed from the base of the PR and between d10c5e9 and c180838.

📒 Files selected for processing (14)
  • apps/fxc-front/src/app/components/2d/marker-element.ts
  • apps/fxc-front/src/app/components/2d/path-element.ts
  • apps/fxc-front/src/app/components/2d/skyways-element.ts
  • apps/fxc-front/src/app/components/2d/tracking-element.ts
  • apps/fxc-front/src/app/components/3d/marker3d-element.ts
  • apps/fxc-front/src/app/components/3d/skyways3d-element.ts
  • apps/fxc-front/src/app/components/3d/tracking3d-element.ts
  • apps/fxc-front/src/app/components/ui/main-menu.ts
  • apps/fxc-front/src/app/components/ui/pref-modal.ts
  • apps/fxc-front/src/app/components/ui/share-modal.ts
  • apps/fxc-front/src/app/components/ui/track-modal.ts
  • apps/fxc-front/src/app/components/ui/waypoint-modal.ts
  • apps/fxc-front/src/app/pages/admin.ts
  • apps/fxc-front/src/app/pages/archives.ts
💤 Files with no reviewable changes (4)
  • apps/fxc-front/src/app/components/3d/tracking3d-element.ts
  • apps/fxc-front/src/app/components/ui/share-modal.ts
  • apps/fxc-front/src/app/pages/admin.ts
  • apps/fxc-front/src/app/pages/archives.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.


Walkthrough

The pull request updates marker lifecycle handling and path-listener cleanup. It also makes several component fields private and renames WaypointModal’s prefix state field.

Changes

Frontend components

Layer / File(s) Summary
Marker lifecycle and rendering
apps/fxc-front/src/app/components/2d/marker-element.ts
MarkerElement retains its advanced marker reference and uses it in connection and disconnection hooks. It detaches the marker when track is absent and rounds scale and stroke-width values to four decimal places.
Path listener cleanup
apps/fxc-front/src/app/components/2d/path-element.ts
PathElement uses the corrected onPointAdded property name and removes listener handles through their remove() methods.
Component state declarations
apps/fxc-front/src/app/components/2d/{skyways-element,tracking-element}.ts, apps/fxc-front/src/app/components/3d/*, apps/fxc-front/src/app/components/ui/{main-menu,pref-modal,share-modal,track-modal}.ts, apps/fxc-front/src/app/pages/{admin,archives}.ts
Several component fields are now private. State decorators and initial values remain unchanged. Other included declaration and whitespace changes do not change behavior.
Waypoint prefix binding
apps/fxc-front/src/app/components/ui/waypoint-modal.ts
WaypointModal renames its state field from prefix to namePrefix and uses the new name in the input, change handler, and download value. The download payload key remains prefix.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to c1808

The reviewed marker lifecycle changes have no established issue blocking merge.

Security Architecture Review

Security architecture risk: 🔵 Low · up to c1808

Normal track removal appears to detach its marker. A reused marker component can nevertheless restore an obsolete marker after its track has been cleared. The identified effect is confined to the browser map; no new server access or cross-user exposure was established.

Retained concerns

  • Low · reliability · inferred: If a marker component is reused after its track is cleared, reconnection can attach its retained, obsolete map marker even though rendering has removed that marker. The current keyed map caller removes the component on ordinary track removal, so this is a conditional lifecycle and ownership failure, not an established normal-flow or cross-user exposure.
Security review details

Security Blast Radius

  • inferred — The identified stale-marker sequence affects a map overlay in a reused browser component. The inspected caller removes keyed components normally; evidence does not establish a new server privilege, tenant boundary crossing, or cross-user exposure.

Trust Boundaries and Controls

  • observed — The waypoint modal still sends the selected prefix under the existing request key; the unchanged route passes that value to encoding and returns a file attachment. Authentication and middleware for that existing route were not established by this inspection.

Resilience and Maintainability Implications

  • inferred — The marker's cleanup normally contains removed tracks, but a retained reference can undermine that ownership guarantee if the host is reused after its track is cleared.

Hardening Proposals

  • proposed — Clear the retained marker reference when its rendered node is removed, and gate reconnection attachment on a current track and marker ownership.
🚥 Pre-merge checks | ✅ 4 | ❓ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title references marker changes, which are part of the pull request, but it uses a branch-style name and does not clearly summarize the broader changes. Replace the title with a concise summary, such as "Improve marker lifecycle handling and component state visibility".
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit watched the markers glow,
Then saw them safely come and go.
A path listener found its name,
The waypoint prefix changed the same.
Soft paws applaud each tidy frame.

Comment @coderabbitai help to get the list of available commands.

@vicb
vicb merged commit 9f53fa2 into master Sep 27, 2026
7 checks passed
@vicb
vicb deleted the vicb/marker branch September 27, 2026 20:12
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.

1 participant