Skip to content

fix: tooltips across the console and webhooks flow#2944

Open
HarshMN2345 wants to merge 1 commit intomainfrom
fix-tooltips-and-webhook-flows
Open

fix: tooltips across the console and webhooks flow#2944
HarshMN2345 wants to merge 1 commit intomainfrom
fix-tooltips-and-webhook-flows

Conversation

@HarshMN2345
Copy link
Copy Markdown
Member

@HarshMN2345 HarshMN2345 commented Mar 29, 2026

What does this PR do?

(Provide a description of what this PR does.)

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)

Related PRs and Issues

(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)

Have you read the Contributing Guidelines on issues?

(Write your answer here.)

Summary by CodeRabbit

  • New Features

    • Added guidance text to webhook URL field clarifying accepted URL formats and restrictions.
  • Improvements

    • Enhanced tooltip styling and sizing consistency across the console for improved readability.
    • Improved error handling in webhook creation with clearer notifications.

@HarshMN2345 HarshMN2345 requested a review from Meldiron March 29, 2026 14:53
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 29, 2026

Walkthrough

This PR standardizes tooltip styling across the console UI by introducing three reusable CSS constants in a new helper file, then applying them to 13 pages and components to unify tooltip width constraints and text wrapping behavior. It also adds a helper text property to the InputURL component, updates webhook creation error handling from throwing to notification-based, and adds descriptive helper text for the webhook POST URL field.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective: fixing tooltips across console and webhooks flow, which aligns with the widespread tooltip styling changes and new helper constants throughout the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-tooltips-and-webhook-flows

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.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 29, 2026

Greptile Summary

This PR has two related goals: (1) centralise tooltip styling across the console into a small set of shared constants (BODY_TOOLTIP_MAX_WIDTH, BODY_TOOLTIP_WRAPPER_STYLE, BODY_TOOLTIP_WRAPPER_STYLE_PRELINE), and (2) fix a broken webhook-creation flow where the error handler used the wrong analytics event (Submit.DomainCreate instead of Submit.WebhookCreate), passed a plain string to trackError instead of the Error object, and re-threw the error rather than surfacing a user-friendly notification.

  • New src/lib/helpers/tooltipContent.ts cleanly centralises three repeated style values used across ~15 files.
  • The inputURL.svelte component gains a helper prop (errors correctly take priority via error || helper), enabling the new descriptive hint text on the webhook POST-URL field.
  • Webhook error handling is now correct: uses Submit.WebhookCreate, passes the full error object to trackError, and shows a notification instead of throwing.
  • One minor inconsistency remains: the TTL tooltip in createRecordModal.svelte still uses a raw inline style (white-space: pre-line;) instead of the new BODY_TOOLTIP_WRAPPER_STYLE_PRELINE constant, so it is missing the overflow-wrap: break-word property applied everywhere else.

Confidence Score: 5/5

Safe to merge — all changes are UI/tooltip styling refactors or minor bug fixes with no data-integrity risk.

The only open finding is a P2 style inconsistency in createRecordModal.svelte where the TTL tooltip omits the BODY_TOOLTIP_WRAPPER_STYLE_PRELINE constant. All other changes are clean refactors using the new shared constants, and the webhook error-handling fix is an unambiguous improvement.

src/routes/(console)/organization-[organization]/domains/domain-[domain]/createRecordModal.svelte — TTL tooltip still uses raw inline style

Important Files Changed

Filename Overview
src/lib/helpers/tooltipContent.ts New helper file centralizing tooltip max-width and wrapper styles into shared constants — clean DRY approach
src/lib/elements/forms/inputURL.svelte Adds optional helper prop; error takes priority via `error
src/routes/(console)/project-[region]-[project]/settings/webhooks/create/+page.svelte Fixes error handling: wrong Submit.DomainCreate → Submit.WebhookCreate, passes full error object to trackError, and surfaces errors via notification instead of re-throwing
src/routes/(console)/project-[region]-[project]/settings/webhooks/create/step1.svelte Adds helper text on the POST URL input explaining URL requirements for Appwrite Cloud
src/routes/(console)/organization-[organization]/domains/domain-[domain]/createRecordModal.svelte Value tooltip gets maxWidth="fit-content"; TTL tooltip still uses raw inline style instead of BODY_TOOLTIP_WRAPPER_STYLE_PRELINE constant, missing overflow-wrap and min-width properties
src/lib/layout/containerButton.svelte Adopts BODY_TOOLTIP_MAX_WIDTH and BODY_TOOLTIP_WRAPPER_STYLE constants for tooltip styling
src/routes/(console)/organization-[organization]/header.svelte Migrates trial badge and invite-button tooltips to shared constants
src/routes/(console)/project-[region]-[project]/functions/function-[function]/executions/+page.svelte Replaces span tooltip slots with div+BODY_TOOLTIP_WRAPPER_STYLE_PRELINE for both empty-state and header tooltips

Reviews (1): Last reviewed commit: "fix: tooltips across the console and web..." | Re-trigger Greptile

<Tooltip slot="info">
<Icon icon={IconInfo} size="s" />
<span slot="tooltip">
<div style="white-space: pre-line;" slot="tooltip">
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 Inconsistent tooltip style — missing overflow-wrap

The TTL tooltip still uses a raw inline style string rather than the new BODY_TOOLTIP_WRAPPER_STYLE_PRELINE constant introduced in this PR. The inline style only sets white-space: pre-line, while the constant also includes min-width: 0, max-width: 100%, and overflow-wrap: break-word. The missing overflow-wrap property means long unbreakable words could overflow the tooltip on narrow viewports.

Suggested change
<div style="white-space: pre-line;" slot="tooltip">
<div style={BODY_TOOLTIP_WRAPPER_STYLE_PRELINE} slot="tooltip">

BODY_TOOLTIP_WRAPPER_STYLE_PRELINE would need to be imported from $lib/helpers/tooltipContent in the <script> block as well.

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.

🧹 Nitpick comments (2)
src/routes/(console)/organization-[organization]/domains/domain-[domain]/createRecordModal.svelte (1)

114-117: Prefer shared pre-line tooltip style constant instead of inline style literal.

This keeps tooltip formatting consistent with the rest of the PR and avoids style string duplication.

♻️ Proposed refactor
 import { createRecord } from '$lib/helpers/domains';
+import { BODY_TOOLTIP_WRAPPER_STYLE_PRELINE } from '$lib/helpers/tooltipContent';
 import { showPriority } from './table.svelte';
@@
-                    <div style="white-space: pre-line;" slot="tooltip">
+                    <div style={BODY_TOOLTIP_WRAPPER_STYLE_PRELINE} slot="tooltip">
                         TTL defines how long DNS information is cached. Lower values update faster;
                         higher values reduce server load.
                     </div>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/routes/`(console)/organization-[organization]/domains/domain-[domain]/createRecordModal.svelte
around lines 114 - 117, The tooltip div in createRecordModal.svelte uses an
inline style literal ("white-space: pre-line;") which duplicates formatting;
replace this inline style with the shared tooltip pre-line style by importing
the shared constant or applying the shared CSS class used across the project
(e.g., PRE_LINE_TOOLTIP_STYLE or a common TooltipPreLine class) and update the
div with slot="tooltip" to use that import/class instead of the inline style to
keep formatting consistent.
src/routes/(console)/project-[region]-[project]/settings/webhooks/create/+page.svelte (1)

52-57: Add a regression test for the non-throwing error path.

Given this changes control flow, a test should assert that failed create shows an error notification and does not navigate.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/routes/`(console)/project-[region]-[project]/settings/webhooks/create/+page.svelte
around lines 52 - 57, A regression test is missing for the non-throwing error
path introduced in the webhook creation flow: add a test that simulates the
create call failing without throwing and asserts that addNotification is called
with an error message and that navigation does not occur; locate the submit
handler in +page.svelte (the code that calls addNotification and trackError with
Submit.WebhookCreate) and mock the create API to return a failure response, then
verify addNotification(...) was invoked and the router/navigation function was
not called and trackError was invoked with Submit.WebhookCreate.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@src/routes/`(console)/organization-[organization]/domains/domain-[domain]/createRecordModal.svelte:
- Around line 114-117: The tooltip div in createRecordModal.svelte uses an
inline style literal ("white-space: pre-line;") which duplicates formatting;
replace this inline style with the shared tooltip pre-line style by importing
the shared constant or applying the shared CSS class used across the project
(e.g., PRE_LINE_TOOLTIP_STYLE or a common TooltipPreLine class) and update the
div with slot="tooltip" to use that import/class instead of the inline style to
keep formatting consistent.

In
`@src/routes/`(console)/project-[region]-[project]/settings/webhooks/create/+page.svelte:
- Around line 52-57: A regression test is missing for the non-throwing error
path introduced in the webhook creation flow: add a test that simulates the
create call failing without throwing and asserts that addNotification is called
with an error message and that navigation does not occur; locate the submit
handler in +page.svelte (the code that calls addNotification and trackError with
Submit.WebhookCreate) and mock the create API to return a failure response, then
verify addNotification(...) was invoked and the router/navigation function was
not called and trackError was invoked with Submit.WebhookCreate.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fed92d19-c275-4f20-8b1a-f6f154c63b81

📥 Commits

Reviewing files that changed from the base of the PR and between 00d9765 and 0dd8cff.

📒 Files selected for processing (17)
  • src/lib/elements/forms/inputURL.svelte
  • src/lib/helpers/tooltipContent.ts
  • src/lib/layout/containerButton.svelte
  • src/routes/(console)/account/organizations/+page.svelte
  • src/routes/(console)/organization-[organization]/+page.svelte
  • src/routes/(console)/organization-[organization]/domains/domain-[domain]/createRecordModal.svelte
  • src/routes/(console)/organization-[organization]/header.svelte
  • src/routes/(console)/organization-[organization]/members/+page.svelte
  • src/routes/(console)/project-[region]-[project]/databases/+page.svelte
  • src/routes/(console)/project-[region]-[project]/functions/+page.svelte
  • src/routes/(console)/project-[region]-[project]/functions/function-[function]/executions/+page.svelte
  • src/routes/(console)/project-[region]-[project]/overview/platforms/action.svelte
  • src/routes/(console)/project-[region]-[project]/settings/webhooks/+page.svelte
  • src/routes/(console)/project-[region]-[project]/settings/webhooks/create/+page.svelte
  • src/routes/(console)/project-[region]-[project]/settings/webhooks/create/step1.svelte
  • src/routes/(console)/project-[region]-[project]/sites/site-[site]/+page.svelte
  • src/routes/(console)/project-[region]-[project]/storage/+page.svelte

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