Skip to content

chat banner entry point#2128

Closed
cleo-pleurodon wants to merge 2 commits into
mainfrom
project-work
Closed

chat banner entry point#2128
cleo-pleurodon wants to merge 2 commits into
mainfrom
project-work

Conversation

@cleo-pleurodon
Copy link
Copy Markdown

HACKATHON

  • Trigger banner based on chat input for hackathon demo
  • acts as an entry point to posthog work
CleanShot 2026-05-13 at 14 24 38@2x

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 13, 2026

Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
apps/code/src/renderer/features/sessions/components/TryInPostHogWorkBanner.tsx:34-36
**"Try in PostHog Work" button is non-functional**

The primary CTA button has no `onClick` handler, so clicking it does nothing. For a feature explicitly described as an "entry point to PostHog Work," this means the banner shows up but the main action it advertises can never be triggered.

### Issue 2 of 2
apps/code/src/renderer/features/sessions/components/SessionView.tsx:253-270
**Duplicated banner logic violates OnceAndOnlyOnce**

The same four state values (`showPostHogWorkBanner`, `postHogWorkBannerDismissed`) plus `handlePromptTextChange` and `handleDismissPostHogWorkBanner` — including the hardcoded `/pineapple/i` trigger — are copied verbatim into `TaskInput.tsx`. Any change to the trigger word or show/hide logic must be made in two places. Extracting a `usePostHogWorkBanner()` hook would keep this in one place.

Reviews (1): Last reviewed commit: "chat banner entry point" | Re-trigger Greptile

Comment on lines +34 to +36
<Button size="2" variant="solid" color="gray" highContrast>
<Text className="px-2 text-[12px]">Try in PostHog Work</Text>
</Button>
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.

P1 "Try in PostHog Work" button is non-functional

The primary CTA button has no onClick handler, so clicking it does nothing. For a feature explicitly described as an "entry point to PostHog Work," this means the banner shows up but the main action it advertises can never be triggered.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/sessions/components/TryInPostHogWorkBanner.tsx
Line: 34-36

Comment:
**"Try in PostHog Work" button is non-functional**

The primary CTA button has no `onClick` handler, so clicking it does nothing. For a feature explicitly described as an "entry point to PostHog Work," this means the banner shows up but the main action it advertises can never be triggered.

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines 253 to +270
const [isDraggingFile, setIsDraggingFile] = useState(false);
const [showPostHogWorkBanner, setShowPostHogWorkBanner] = useState(false);
const [postHogWorkBannerDismissed, setPostHogWorkBannerDismissed] =
useState(false);
const editorRef = useRef<PromptInputHandle>(null);
const dragCounterRef = useRef(0);

const handlePromptTextChange = useCallback(
(text: string) => {
if (postHogWorkBannerDismissed) return;
if (/pineapple/i.test(text)) {
setShowPostHogWorkBanner(true);
}
},
[postHogWorkBannerDismissed],
);

const handleDismissPostHogWorkBanner = useCallback(() => {
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.

P2 Duplicated banner logic violates OnceAndOnlyOnce

The same four state values (showPostHogWorkBanner, postHogWorkBannerDismissed) plus handlePromptTextChange and handleDismissPostHogWorkBanner — including the hardcoded /pineapple/i trigger — are copied verbatim into TaskInput.tsx. Any change to the trigger word or show/hide logic must be made in two places. Extracting a usePostHogWorkBanner() hook would keep this in one place.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/sessions/components/SessionView.tsx
Line: 253-270

Comment:
**Duplicated banner logic violates OnceAndOnlyOnce**

The same four state values (`showPostHogWorkBanner`, `postHogWorkBannerDismissed`) plus `handlePromptTextChange` and `handleDismissPostHogWorkBanner` — including the hardcoded `/pineapple/i` trigger — are copied verbatim into `TaskInput.tsx`. Any change to the trigger word or show/hide logic must be made in two places. Extracting a `usePostHogWorkBanner()` hook would keep this in one place.

How can I resolve this? If you propose a fix, please make it concise.

Introduces a top-level mode toggle above the nav list. Work mode is an
empty shell — placeholder for an upcoming feature set built during the
hackathon.

Generated-By: PostHog Code
Task-Id: bd0f6387-4ee8-42a4-b17d-80927d214463
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 13, 2026

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
apps/code/src/renderer/features/sessions/components/SessionView.tsx:260-268
The banner stays visible after the trigger word is deleted from the input. Once "pineapple" is typed the banner appears, but if the user then edits the text to remove it the banner remains — there is no branch that sets `showPostHogWorkBanner` back to `false`. The same issue exists in `TaskInput.tsx`.

```suggestion
  const handlePromptTextChange = useCallback(
    (text: string) => {
      if (postHogWorkBannerDismissed) return;
      setShowPostHogWorkBanner(/pineapple/i.test(text));
    },
    [postHogWorkBannerDismissed],
  );
```

Reviews (2): Last reviewed commit: "feat(code): add Code/Work mode switcher ..." | Re-trigger Greptile

Comment on lines +260 to +268
const handlePromptTextChange = useCallback(
(text: string) => {
if (postHogWorkBannerDismissed) return;
if (/pineapple/i.test(text)) {
setShowPostHogWorkBanner(true);
}
},
[postHogWorkBannerDismissed],
);
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.

P1 The banner stays visible after the trigger word is deleted from the input. Once "pineapple" is typed the banner appears, but if the user then edits the text to remove it the banner remains — there is no branch that sets showPostHogWorkBanner back to false. The same issue exists in TaskInput.tsx.

Suggested change
const handlePromptTextChange = useCallback(
(text: string) => {
if (postHogWorkBannerDismissed) return;
if (/pineapple/i.test(text)) {
setShowPostHogWorkBanner(true);
}
},
[postHogWorkBannerDismissed],
);
const handlePromptTextChange = useCallback(
(text: string) => {
if (postHogWorkBannerDismissed) return;
setShowPostHogWorkBanner(/pineapple/i.test(text));
},
[postHogWorkBannerDismissed],
);
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/sessions/components/SessionView.tsx
Line: 260-268

Comment:
The banner stays visible after the trigger word is deleted from the input. Once "pineapple" is typed the banner appears, but if the user then edits the text to remove it the banner remains — there is no branch that sets `showPostHogWorkBanner` back to `false`. The same issue exists in `TaskInput.tsx`.

```suggestion
  const handlePromptTextChange = useCallback(
    (text: string) => {
      if (postHogWorkBannerDismissed) return;
      setShowPostHogWorkBanner(/pineapple/i.test(text));
    },
    [postHogWorkBannerDismissed],
  );
```

How can I resolve this? If you propose a fix, please make it concise.

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