Skip to content

PostHog AANTS#1528

Open
xgraceyan wants to merge 19 commits intomainfrom
posthog-aants
Open

PostHog AANTS#1528
xgraceyan wants to merge 19 commits intomainfrom
posthog-aants

Conversation

@xgraceyan
Copy link
Copy Markdown
Contributor

Summary

Posthog analytics for AANTS. Based off PostHog Auth which should be merged first

  • Open manage notifications dialog
  • Close manage notifications dialog
  • Open notification dropdown in section row
  • Toggle notify open/wl/full/restriction
  • Delete notification

Test Plan

Try the actions listed here and see if Posthog logs them accordingly with the correct properties.

Issues

Closes #

@xgraceyan
Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai Bot commented Mar 4, 2026

@cubic-dev-ai

@xgraceyan I have started the AI code review. It will take a few minutes to complete.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

4 issues found across 14 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/antalmanac/src/components/Header/Save.tsx">

<violation number="1" location="apps/antalmanac/src/components/Header/Save.tsx:27">
P2: Analytics event `CLICK_SAVE` will also fire when the user **closes** the sign-in dialog, since `handleClickSignIn` is reused as the `onClose` handler for `SignInDialog` (line 130). This will produce misleading analytics data. Consider either splitting the handler into separate open/close functions, or gating the log on the current dialog state (e.g., only log when `openSignInDialog` is `false`, meaning the dialog is about to open).</violation>
</file>

<file name="apps/antalmanac/src/components/Header/Signout.tsx">

<violation number="1" location="apps/antalmanac/src/components/Header/Signout.tsx:50">
P1: The `logAnalytics` call for `SIGN_OUT` is placed **after** `window.location.href = logoutUrl`, so when a logout URL is present, the browser navigates away before PostHog can flush the event. This means the sign-out event will never actually be recorded.

Move the `logAnalytics` call (and potentially `postHog?.reset()`) **before** the redirect to ensure the event is captured.</violation>
</file>

<file name="apps/antalmanac/src/components/Header/Signin.tsx">

<violation number="1" location="apps/antalmanac/src/components/Header/Signin.tsx:115">
P2: Redundant `analyticsIdentifyUser` call may overwrite correct OAuth identity with a stale guest user ID. `loadScheduleWithSessionToken` already identifies the user internally using the real user ID from the backend. This second call uses `userID` from the function parameter (sourced from `savedUserID` in localStorage), which could be a legacy guest ID — causing PostHog to misidentify an OAuth user.

Remove this line since identification is already handled inside `loadScheduleWithSessionToken`.</violation>
</file>

<file name="apps/antalmanac/src/components/Header/Import.tsx">

<violation number="1" location="apps/antalmanac/src/components/Header/Import.tsx:166">
P2: The `term` parameter is immediately shadowed by `const term = RightPaneStore.getFormData().term;` inside the function body, making this parameter dead code. The value passed by callers is silently ignored. Either remove the parameter and its corresponding arguments from all call sites, or remove the inner `const term` declaration to use the passed-in value.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread apps/antalmanac/src/components/Header/Signout.tsx
Comment thread apps/antalmanac/src/components/Header/Save.tsx Outdated
Comment thread apps/antalmanac/src/components/Header/Signin.tsx Outdated
Comment thread apps/antalmanac/src/components/Header/Import.tsx Outdated
@xgraceyan
Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai Bot commented Mar 4, 2026

@cubic-dev-ai

@xgraceyan I have started the AI code review. It will take a few minutes to complete.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 14 files

@xgraceyan xgraceyan marked this pull request as ready for review March 5, 2026 01:31
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 14 files

@alexespejo
Copy link
Copy Markdown
Collaborator

Error: Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under '/home/runner/work/AntAlmanac/AntAlmanac/.github/actions/cache-generated-data'. Did you forget to run actions/checkout before running your local action?

@alexespejo
Copy link
Copy Markdown
Collaborator

/deploy

@KevinWu098
Copy link
Copy Markdown
Member

What's going on over here 👅

@github-actions github-actions Bot removed the Stale label Apr 30, 2026
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.

4 participants