Skip to content

fix: minor bugs and UX polish batch#116

Merged
TerrifiedBug merged 4 commits intomainfrom
minor-bugs-f99
Mar 28, 2026
Merged

fix: minor bugs and UX polish batch#116
TerrifiedBug merged 4 commits intomainfrom
minor-bugs-f99

Conversation

@TerrifiedBug
Copy link
Copy Markdown
Owner

Summary

  • Webhook settings loading fix — add team hydration guard so the page shows loading skeletons instead of "Failed to load webhook endpoints" when the Zustand store hasn't hydrated yet; surface actual TRPC error message on real failures
  • useSSE console warning — downgrade duplicate mount warning from console.warn to console.debug (fires in dev due to React Strict Mode, guard logic is correct)
  • Backup storage toggle — replace ambiguous Switch with a segmented control ([ Local | S3 ]) that clearly communicates a choice between two options
  • Node enrollment instructions — add copy-able Quick Start snippets for Linux (install.sh one-liner) and Docker (docker run) to the environment detail page with pre-filled server URL and token; update public docs

Test plan

  • Navigate to /settings/webhooks — page loads without error
  • Check browser dev console — no [useSSE] warning at warn level
  • Navigate to /settings/backup — storage backend shows segmented control, selecting S3 reveals credential fields
  • Navigate to an environment detail page, generate a token — Quick Start section appears with Linux and Docker commands containing the actual server URL and token
  • Copy buttons work for both enrollment snippets
  • Verify dark mode works for segmented control and Quick Start section

Add selectedTeamId guard before the error check so the page shows
loading skeletons instead of a failed query when the Zustand store
hasn't hydrated yet. Also surface the actual TRPC error message.
The Switch looked like an enable/disable toggle rather than a choice
between Local and S3 storage. The segmented control makes the two
options visually explicit.
Show copy-able Quick Start snippets for both the install.sh one-liner
and docker run command when an enrollment token exists. Server URL and
token are pre-filled dynamically. Also updates the public docs with
both enrollment methods.
@github-actions github-actions bot added fix documentation Improvements or additions to documentation labels Mar 28, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 28, 2026

Greptile Summary

This PR delivers five targeted bug fixes and UX improvements with no functional regressions. The changes are focused and well-scoped:

  • Webhook settings hydration fix: A !selectedTeamId guard added before the listQuery.isError check correctly shows loading skeletons while the Zustand team store is still hydrating, preventing a spurious "Failed to load" error on cold load. The enabled: !!selectedTeamId option already kept the query from firing early; this guard pairs cleanly with it to give users a proper loading state. The actual tRPC error message is now surfaced on genuine failures.
  • useSSE console noise: Downgrading the duplicate-mount log to console.debug is correct — the double-invoke from React Strict Mode is expected and the guard logic is sound.
  • Backup segmented control: The Switch → inline segmented control swap communicates the binary local/S3 choice more clearly; type=\"button\" prevents accidental form submission.
  • Enrollment Quick Start snippets: The new section renders when env.hasEnrollmentToken is true. When a token has just been generated in the current session (enrollmentToken state is set), the commands are pre-filled with window.location.origin and the actual token. When no fresh token is in state (returning visit), a <enrollment-token> placeholder is shown in both the display and the copy buffer, which is intentional and consistent.
  • Docs: Updated to match the new Linux install-script and Docker run commands shown in the UI.

Confidence Score: 5/5

All five changes are correct, scoped, and safe to merge.

No P0 or P1 issues found. The webhook hydration guard is correctly ordered relative to the disabled query, the SSE downgrade is appropriate, the segmented control uses type=button safely, and the Quick Start snippet copy behavior matches what is displayed. All findings are P2 at most.

No files require special attention.

Important Files Changed

Filename Overview
src/app/(dashboard)/settings/webhooks/page.tsx Adds a !selectedTeamId early-return guard that renders loading skeletons before the Zustand store hydrates, and surfaces the actual tRPC error message on real failures instead of a static string.
src/app/(dashboard)/environments/[id]/page.tsx Adds a Quick Start section (visible when env.hasEnrollmentToken is true) with copy-able Linux and Docker enrollment commands pre-filled with window.location.origin and the just-generated token; no issues found.
src/app/(dashboard)/settings/_components/backup-settings.tsx Replaces the ambiguous Switch with an inline segmented control (Local
src/hooks/use-sse.ts Downgrades the duplicate-mount log from console.warn to console.debug — correct since React Strict Mode double-invoke is expected and not actionable by the user.
docs/public/user-guide/environments.md Updates enrollment token documentation to include Linux install script and Docker run examples, consistent with the new UI snippets added in environments/[id]/page.tsx.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[WebhookEndpointsSettings renders] --> B{selectedTeamId?}
    B -- No --> C[Return skeletons\nZustand not hydrated yet]
    B -- Yes --> D[listQuery enabled\nfetch webhooks]
    D --> E{listQuery.isError?}
    E -- Yes --> F[QueryError with\nlistQuery.error.message\nor fallback string]
    E -- No --> G[Render endpoint list\nor empty state]

    H[Environment Detail Page] --> I{env.hasEnrollmentToken?}
    I -- Yes --> J[Show Quick Start section]
    J --> K{enrollmentToken state set?}
    K -- Yes --> L[Snippets show actual token +\ncopy embeds real token]
    K -- No --> M[Snippets show placeholder\ncopy embeds placeholder]
Loading

Reviews (1): Last reviewed commit: "feat: add Linux and Docker enrollment in..." | Re-trigger Greptile

@TerrifiedBug TerrifiedBug merged commit c3163b2 into main Mar 28, 2026
14 checks passed
@TerrifiedBug TerrifiedBug deleted the minor-bugs-f99 branch March 28, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant