Skip to content

chore(web): replace snippet action with CLI guidance#183

Open
alan747271363-art wants to merge 1 commit into
tryabby:mainfrom
alan747271363-art:codex/replace-snippet-action-with-cli
Open

chore(web): replace snippet action with CLI guidance#183
alan747271363-art wants to merge 1 commit into
tryabby:mainfrom
alan747271363-art:codex/replace-snippet-action-with-cli

Conversation

@alan747271363-art
Copy link
Copy Markdown

@alan747271363-art alan747271363-art commented May 31, 2026

Summary

  • replaces the dashboard Generate Code Snippet menu action with a CLI setup link
  • keeps the existing project ID copy action intact
  • tracks the new CLI instruction click separately

Closes #78.

Validation

  • pnpm install --frozen-lockfile
  • pnpm exec biome check apps/web/src/components/CodeSnippetModalButton.tsx
  • pnpm --filter web test -- --run --passWithNoTests was attempted; the suite still fails during test collection due existing module resolution problems (server/queue/Manager and @tryabby/core) outside this UI component change.

Summary by CodeRabbit

  • New Features
    • Added "Setup via CLI" option to the menu that opens CLI documentation in a new tab

@vercel
Copy link
Copy Markdown

vercel Bot commented May 31, 2026

@alan747271363-art is attempting to deploy a commit to the cstrnt's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 31, 2026

Review Change Stack

Walkthrough

CodeSnippetModalButton removes its internal code snippet modal UI and replaces it with a dropdown menu item that opens CLI documentation. Modal-related state and imports are removed, DOCS_URL is added, and a new "Setup via CLI" menu item with event tracking opens the CLI reference guide in a new tab.

Changes

Replace Code Snippet Modal with CLI Documentation Link

Layer / File(s) Summary
Remove modal implementation and add CLI documentation menu item
apps/web/src/components/CodeSnippetModalButton.tsx
Imports updated to add DOCS_URL and use Terminal icon; modal-related state removed from component initialization; new dropdown menu item tracks "Dashboard CLI Instructions Clicked" event and opens CLI documentation in a new tab.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

πŸš₯ Pre-merge checks | βœ… 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
βœ… Passed checks (4 passed)
Check name Status Explanation
Description Check βœ… Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check βœ… Passed The title accurately summarizes the main change: replacing the code snippet generation action with CLI guidance.
Linked Issues check βœ… Passed The PR directly addresses issue #78 by removing the code snippet generation button and replacing it with CLI setup instructions.
Out of Scope Changes check βœ… Passed All changes are scoped to the CodeSnippetModalButton component and directly related to replacing snippet generation with CLI guidance.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

πŸ”§ ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

πŸ€– Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/web/src/components/CodeSnippetModalButton.tsx`:
- Line 47: Add the missing event name to the PlausibleEvents type so the call
trackEvent("Dashboard CLI Instructions Clicked") is statically allowed: edit the
PlausibleEvents declaration (the type used by useTracking) and add a property
"Dashboard CLI Instructions Clicked": never (or an appropriate props type if
needed). Ensure PlausibleEvents is exported/updated so useTracking and the call
in CodeSnippetModalButton.tsx pick up the new event name.
πŸͺ„ Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
βš™οΈ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 664c3bd3-28e6-45aa-a881-c91b126ff623

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between e763d1a and 069894f.

πŸ“’ Files selected for processing (1)
  • apps/web/src/components/CodeSnippetModalButton.tsx

Generate Code Snippet
<DropdownMenuItem
onClick={() => {
trackEvent("Dashboard CLI Instructions Clicked");
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.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify whether the new event is declared in tracking contracts/types and how useTracking is typed.

set -euo pipefail

echo "== Locate useTracking implementation =="
fd -i 'tracking.ts' apps/web/src lib src || true
rg -n -C3 '\buseTracking\b|\btrackEvent\b' apps/web/src lib src

echo
echo "== Locate event type maps / schemas =="
rg -n -C3 'type\s+ServerEvents|type\s+.*Events|Dashboard CLI Instructions Clicked|Dashboard Code Clicked' apps/web/src packages

echo
echo "== Inspect plausible event declarations =="
fd -i 'plausible-events.ts' apps/web/src packages || true
rg -n -C3 'flag_removal_pr_created|Dashboard CLI Instructions Clicked' apps/web/src packages

Repository: tryabby/abby

Length of output: 22877


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Locate PlausibleEvents typing file =="
fd -i 'plausible-events.ts' apps/web/src

echo
echo "== Search for the new event in the plausible event types =="
rg -n "Dashboard CLI Instructions Clicked" apps/web/src/types apps/web/src/lib

echo
echo "== Inspect plausible-events.ts (event list area) =="
plf="$(fd -i 'plausible-events.ts' apps/web/src | head -n 1)"
wc -l "$plf"
sed -n '1,220p' "$plf"

Repository: tryabby/abby

Length of output: 197


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Inspect plausible-events.ts =="
plf="apps/web/src/types/plausible-events.ts"
wc -l "$plf"
sed -n '1,220p' "$plf"

echo
echo "== Inspect useTracking (apps/web/src/lib/tracking.ts) =="
trk="apps/web/src/lib/tracking.ts"
wc -l "$trk"
sed -n '1,220p' "$trk"

echo
echo "== Search for Dashboard CLI Instructions Clicked in the repo =="
rg -n "Dashboard CLI Instructions Clicked" .

Repository: tryabby/abby

Length of output: 1985


Add "Dashboard CLI Instructions Clicked" to the tracked-events typing

useTracking is typed by PlausibleEvents (apps/web/src/lib/tracking.ts β†’ apps/web/src/types/plausible-events.ts), but "Dashboard CLI Instructions Clicked" is not present in PlausibleEventsβ€”so this event name should be added there (with never if it has no props).

πŸ€– Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/web/src/components/CodeSnippetModalButton.tsx` at line 47, Add the
missing event name to the PlausibleEvents type so the call trackEvent("Dashboard
CLI Instructions Clicked") is statically allowed: edit the PlausibleEvents
declaration (the type used by useTracking) and add a property "Dashboard CLI
Instructions Clicked": never (or an appropriate props type if needed). Ensure
PlausibleEvents is exported/updated so useTracking and the call in
CodeSnippetModalButton.tsx pick up the new event name.

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.

Remove Code Snippet Generation Button in the Projects Dashboard

1 participant