Skip to content

feat: improve recent domains section spacing and text truncation#40970

Merged
jacquesikot merged 2 commits intoreleasefrom
fix/multi-org-domain-tracking-on-signup
Jun 19, 2025
Merged

feat: improve recent domains section spacing and text truncation#40970
jacquesikot merged 2 commits intoreleasefrom
fix/multi-org-domain-tracking-on-signup

Conversation

@jacquesikot
Copy link
Contributor

@jacquesikot jacquesikot commented Jun 18, 2025

📝 Summary

This PR improves the visual design and user experience of the recent domains section on the signup page with better spacing, text truncation, and simplified domain validation to account for dev and app subdomains.

🎨 Changes Made

SignUp Component (app/client/src/pages/UserAuth/SignUp.tsx)

  • Reduced top margin: Changed from mt-12 to mt-8 for better visual balance
  • Improved spacing: Added conditional bottom margin logic - removed margin from the last domain item to prevent extra spacing
  • Enhanced text display: Added max-w-[180px] line-clamp-1 classes to organization names and domain text to:
    • Limit maximum width to 180px
    • Truncate long text to single line with ellipsis
    • Prevent layout breaking with long domain names

Domain Validation (app/client/src/utils/multiOrgDomains.ts)

  • Simplified validation: Removed redundant regex check (/^[a-z0-9-]+\.appsmith\.com$/i.test(domain)) from isValidAppsmithDomain function to account for dev and app subdomains
  • Cleaner logic: Validation now relies on the existing prefix checks and .appsmith.com suffix validation

/ok-to-test tags="@tag.Sanity, @tag.Authentication"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/15727210490
Commit: 5f976b0
Cypress dashboard.
Tags: @tag.Sanity, @tag.Authentication
Spec:


Thu, 19 Jun 2025 00:18:50 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • Style

    • Improved spacing and layout in the recent domains section for a cleaner appearance.
    • Organization name and domain text now truncate with ellipsis if too long, ensuring single-line display.
  • Bug Fixes

    • Updated domain validation to be less restrictive, allowing a wider range of subdomain formats.

@jacquesikot jacquesikot self-assigned this Jun 18, 2025
@jacquesikot jacquesikot added the ok-to-test Required label for CI label Jun 18, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 18, 2025

Walkthrough

This change updates the UI layout and text truncation for the recent domains section on the SignUp page, and relaxes the domain validation logic in the isValidAppsmithDomain utility by removing a strict regex check, now only checking for suffix and prefix conditions.

Changes

File(s) Change Summary
app/client/src/pages/UserAuth/SignUp.tsx Adjusted container margin, conditional domain item spacing, and applied single-line text truncation with ellipsis for organization/domain names.
app/client/src/utils/multiOrgDomains.ts Removed regex from isValidAppsmithDomain, now only checks domain suffix and excludes certain prefixes.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SignUpPage
    participant DomainUtils

    User->>SignUpPage: View recent domains
    SignUpPage->>DomainUtils: isValidAppsmithDomain(domain)
    DomainUtils-->>SignUpPage: true/false
    SignUpPage-->>User: Render recent domains with updated spacing and truncation
Loading

Possibly related PRs

Suggested labels

Enhancement

Suggested reviewers

  • trishaanand
  • ankitakinger

Poem

Recent domains now line up neat,
With margins trimmed and text petite.
Domain checks are more relaxed—
No more regex, that's the fact!
A tidy UI, a simpler rule,
SignUp just got extra cool.
🌟


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 69cd09c and 5f976b0.

📒 Files selected for processing (1)
  • app/client/src/pages/UserAuth/SignUp.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/client/src/pages/UserAuth/SignUp.tsx
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: perform-test / client-build / client-build
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-build / client-build
  • GitHub Check: client-prettier / prettier-check
  • GitHub Check: client-unit-tests / client-unit-tests
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@jacquesikot jacquesikot changed the title refactor: Update SignUp component styles and improve domain display l… feat: improve recent domains section spacing and text truncation Jun 18, 2025
@github-actions github-actions bot added the Enhancement New feature or request label Jun 18, 2025
Copy link
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: 0

🔭 Outside diff range comments (1)
app/client/src/utils/multiOrgDomains.ts (1)

14-20: Validation now permits appsmith.com (root) and other invalid hostnames – restore a stricter check

By dropping the old /^[a-z0-9-]+\.appsmith\.com$/i regex the function now treats appsmith.com (no sub-domain) and strings like "foo bar.appsmith.com" as valid.
This will:

  1. Store / display root or malformed domains in the “recent domains” cookie & UI.
  2. Generate https://appsmith.com/user/login links that almost certainly 404.
  3. Re-open the possibility of malformed hostnames (space, emoji, etc.) sneaking into cookies and link HREFs.

Recommend reinstating a lightweight structural check:

 function isValidAppsmithDomain(domain: string): boolean {
-  return (
-    domain.endsWith(".appsmith.com") &&
-    !domain.startsWith("login.") &&
-    !domain.startsWith("release.") &&
-    !domain.startsWith("dev.")
-  );
+  if (!domain.endsWith(".appsmith.com")) return false;
+
+  // Reject bare apex
+  if (domain === "appsmith.com") return false;
+
+  const subdomain = domain.split(".")[0];
+
+  // Alphanumeric & hyphen, 1–63 chars
+  if (!/^[a-z0-9-]{1,63}$/i.test(subdomain)) return false;
+
+  return !["login", "release", "dev"].includes(subdomain);
 }

This keeps the relaxed rule-set while preventing clearly invalid cases.

🧹 Nitpick comments (2)
app/client/src/pages/UserAuth/SignUp.tsx (2)

117-120: Minor: use clsx / classNames for conditional margin

Template-string concatenation is OK but gets noisy fast. A tiny helper keeps things readable and avoids accidental white-space:

import clsx from "clsx";

<div
  className={clsx(
    "flex items-center justify-between p-1",
    index === recentDomains.length - 1 ? "mb-0" : "mb-3",
  )}
>

127-132: Improve accessibility of truncated text

max-w-[180px] line-clamp-1 neatly truncates long names, but users have no way to see the full value. Adding title={orgName} / title={domain} exposes the complete string on hover and screen-readers:

-<span className="text-md font-semibold text-gray-700 max-w-[180px] line-clamp-1">
+<span
+  className="text-md font-semibold text-gray-700 max-w-[180px] line-clamp-1"
+  title={orgName}
+>

(and same for the domain line).
A tiny tweak for big UX gains.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6459e5f and 69cd09c.

📒 Files selected for processing (2)
  • app/client/src/pages/UserAuth/SignUp.tsx (2 hunks)
  • app/client/src/utils/multiOrgDomains.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: perform-test / client-build / client-build
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: client-build / client-build
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-prettier / prettier-check
🔇 Additional comments (1)
app/client/src/utils/multiOrgDomains.ts (1)

14-20: Summary says “better accommodate dev sub-domains”, but the guard still blocks dev.*

The PR description claims dev-subdomains should now be accepted, yet the function explicitly keeps !domain.startsWith("dev.").
Please confirm which behaviour is desired and update either the code or the PR notes to avoid future confusion.

Likely an incorrect or invalid review comment.

<div
className="flex items-center justify-between p-1 mb-3"
className={`flex items-center justify-between p-1 ${
index === recentDomains.length - 1 ? "mb-0" : "mb-3"
Copy link
Contributor

Choose a reason for hiding this comment

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

can we move this to a variable index === recentDomains.length - 1?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

jsartisan
jsartisan previously approved these changes Jun 18, 2025
@jacquesikot jacquesikot merged commit ad36f76 into release Jun 19, 2025
68 of 74 checks passed
@jacquesikot jacquesikot deleted the fix/multi-org-domain-tracking-on-signup branch June 19, 2025 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request ok-to-test Required label for CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants