Skip to content

feat: Add CustomTermsLinks component to GeneralPage#8808

Merged
Cristhianzl merged 1 commit into
mainfrom
cz/terms-custom
Jul 1, 2025
Merged

feat: Add CustomTermsLinks component to GeneralPage#8808
Cristhianzl merged 1 commit into
mainfrom
cz/terms-custom

Conversation

@Cristhianzl
Copy link
Copy Markdown
Member

@Cristhianzl Cristhianzl commented Jul 1, 2025

This pull request introduces a new CustomTermsLinks component and integrates it into the GeneralPage of the settings section. The changes primarily focus on adding this new component and updating imports accordingly.

Component Addition:

Integration with GeneralPage:

  • src/frontend/src/pages/SettingsPage/pages/GeneralPage/index.tsx:
    • Imported the CustomTermsLinks component.
    • Added the CustomTermsLinks component to the JSX structure of GeneralPage.

Summary by CodeRabbit

  • New Features
    • Added a placeholder section for custom terms and links on the General Settings page. Currently, this section does not display any visible content.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 1, 2025

Walkthrough

A new React component, CustomTermsLinks, was created and added to the GeneralPage of the Settings section. The component currently renders nothing. The GeneralPage was updated to import and include this new component at the bottom of its main content.

Changes

File(s) Change Summary
src/frontend/src/customization/components/custom-terms-links.tsx Added new exported React component CustomTermsLinks (empty render)
src/frontend/src/pages/SettingsPage/pages/GeneralPage/index.tsx Imported and rendered CustomTermsLinks at the end of the page

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant GeneralPage
    participant CustomTermsLinks

    User->>GeneralPage: Render Settings GeneralPage
    GeneralPage->>CustomTermsLinks: Render CustomTermsLinks
    CustomTermsLinks-->>GeneralPage: Returns empty fragment
    GeneralPage-->>User: Displays GeneralPage (with CustomTermsLinks placeholder)
Loading
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Post Copyable Unit Tests in Comment
  • Commit Unit Tests in branch cz/terms-custom

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 auto-generate unit tests to generate unit tests for 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.

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jul 1, 2025
@Cristhianzl Cristhianzl enabled auto-merge July 1, 2025 14:48
@dosubot dosubot Bot added the enhancement New feature or request label Jul 1, 2025
@github-actions github-actions Bot removed the enhancement New feature or request label Jul 1, 2025
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 1, 2025
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 1, 2025
@Cristhianzl Cristhianzl added this pull request to the merge queue Jul 1, 2025
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

🧹 Nitpick comments (1)
src/frontend/src/pages/SettingsPage/pages/GeneralPage/index.tsx (1)

13-13: Gate CustomTermsLinks behind a feature flag (or remove) until it shows real content

Right now CustomTermsLinks is always rendered but does nothing. To avoid unnecessary re-renders and future merge conflicts, consider protecting it with a flag similar to ENABLE_PROFILE_ICONS:

-import { CustomTermsLinks } from "@/customization/components/custom-terms-links";
+import { CustomTermsLinks } from "@/customization/components/custom-terms-links";
+import { ENABLE_CUSTOM_TERMS } from "@/customization/feature-flags";
 ...
-{/* …other JSX… */}
-<CustomTermsLinks />
+{ENABLE_CUSTOM_TERMS && <CustomTermsLinks />}

That keeps the page clean until the component carries user-visible functionality.

Also applies to: 165-166

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 466a18c and 947cf7c.

📒 Files selected for processing (2)
  • src/frontend/src/customization/components/custom-terms-links.tsx (1 hunks)
  • src/frontend/src/pages/SettingsPage/pages/GeneralPage/index.tsx (2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`src/frontend/**/*.{ts,tsx}`: Use React 18 with TypeScript for all UI components and frontend logic.

src/frontend/**/*.{ts,tsx}: Use React 18 with TypeScript for all UI components and frontend logic.

📄 Source: CodeRabbit Inference Engine (.cursor/rules/frontend_development.mdc)

List of files the instruction was applied to:

  • src/frontend/src/customization/components/custom-terms-links.tsx
  • src/frontend/src/pages/SettingsPage/pages/GeneralPage/index.tsx
`src/frontend/**/*.{ts,tsx,js,jsx,css,scss}`: Use Tailwind CSS for styling all frontend components.

src/frontend/**/*.{ts,tsx,js,jsx,css,scss}: Use Tailwind CSS for styling all frontend components.

📄 Source: CodeRabbit Inference Engine (.cursor/rules/frontend_development.mdc)

List of files the instruction was applied to:

  • src/frontend/src/customization/components/custom-terms-links.tsx
  • src/frontend/src/pages/SettingsPage/pages/GeneralPage/index.tsx
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-23T12:46:52.420Z
Learning: Export custom icon components in React using React.forwardRef to ensure proper ref forwarding and compatibility with parent components.
src/frontend/src/customization/components/custom-terms-links.tsx (7)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.494Z
Learning: Applies to src/frontend/**/*.{ts,tsx} : Use React 18 with TypeScript for all UI components and frontend logic.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-23T12:46:52.420Z
Learning: Export custom icon components in React using React.forwardRef to ensure proper ref forwarding and compatibility with parent components.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.494Z
Learning: Applies to src/frontend/src/components/**/*FlowGraph.tsx : Use React Flow for flow graph visualization components.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.494Z
Learning: Applies to src/frontend/src/**/__tests__/**/*.test.{ts,tsx} : All frontend components must have associated tests using React Testing Library.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.494Z
Learning: Applies to src/frontend/src/{components,hooks}/**/*.{ts,tsx} : Implement dark mode support in components and hooks where needed.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-30T14:40:50.836Z
Learning: Applies to src/frontend/src/icons/*/index.tsx : Create an `index.tsx` in your icon directory that exports your icon using `forwardRef` and passes the `isdark` prop.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.494Z
Learning: Applies to src/frontend/src/icons/**/*.{ts,tsx,js,jsx} : Use Lucide React for icons in frontend components.
src/frontend/src/pages/SettingsPage/pages/GeneralPage/index.tsx (5)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.494Z
Learning: Applies to src/frontend/**/*.{ts,tsx} : Use React 18 with TypeScript for all UI components and frontend logic.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.494Z
Learning: Applies to src/frontend/src/{components,hooks}/**/*.{ts,tsx} : Implement dark mode support in components and hooks where needed.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.494Z
Learning: Applies to src/frontend/**/*.{ts,tsx,js,jsx,css,scss} : Use Tailwind CSS for styling all frontend components.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-23T12:46:42.048Z
Learning: Error handling for API calls in React should be abstracted into custom hooks (e.g., useApi), which manage loading and error state and expose an execute function for invoking the API.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-23T12:46:52.420Z
Learning: Export custom icon components in React using React.forwardRef to ensure proper ref forwarding and compatibility with parent components.
🧬 Code Graph Analysis (1)
src/frontend/src/pages/SettingsPage/pages/GeneralPage/index.tsx (1)
src/frontend/src/customization/components/custom-terms-links.tsx (1)
  • CustomTermsLinks (1-3)

Comment on lines +1 to +3
export const CustomTermsLinks = () => {
return <></>;
};
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.

💡 Verification agent

❓ Verification inconclusive

Component currently renders nothing – either implement a minimal stub UI or leave a clear TODO

CustomTermsLinks returns an empty fragment, so mounting it adds no visible value and can be confusing for future maintainers. If this is intentional, at least leave a comment/TODO; otherwise ship a minimal placeholder (e.g. a couple of Tailwind-styled links) so designers can iterate.

 export const CustomTermsLinks = () => {
-  return <></>;
+  // TODO: replace placeholder with real links to Terms & Conditions / Privacy Policy
+  return (
+    <div className="text-xs text-gray-500 dark:text-gray-400">
+      {/* Placeholder content */}
+      <a
+        href="/terms"
+        className="underline hover:no-underline focus:outline-none focus:ring"
+      >
+        Terms&nbsp;of&nbsp;Service
+      </a>
+      {"  •  "}
+      <a
+        href="/privacy"
+        className="underline hover:no-underline focus:outline-none focus:ring"
+      >
+        Privacy&nbsp;Policy
+      </a>
+    </div>
+  );
 };

Add placeholder UI or TODO to CustomTermsLinks component

The CustomTermsLinks component currently returns an empty fragment, which provides no visible output and can be confusing. Please add a minimal stub or a clear TODO so designers can iterate.

  • File: src/frontend/src/customization/components/custom-terms-links.tsx (lines 1–3)

Recommended change:

 export const CustomTermsLinks = () => {
-  return <></>;
+  // TODO: Replace this placeholder with real Terms & Conditions / Privacy Policy links
+  return (
+    <div className="text-xs text-gray-500 dark:text-gray-400">
+      <a
+        href="/terms"
+        className="underline hover:no-underline focus:outline-none focus:ring"
+      >
+        Terms&nbsp;of&nbsp;Service
+      </a>
+      {"  •  "}
+      <a
+        href="/privacy"
+        className="underline hover:no-underline focus:outline-none focus:ring"
+      >
+        Privacy&nbsp;Policy
+      </a>
+    </div>
+  );
 };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export const CustomTermsLinks = () => {
return <></>;
};
export const CustomTermsLinks = () => {
// TODO: Replace this placeholder with real Terms & Conditions / Privacy Policy links
return (
<div className="text-xs text-gray-500 dark:text-gray-400">
<a
href="/terms"
className="underline hover:no-underline focus:outline-none focus:ring"
>
Terms&nbsp;of&nbsp;Service
</a>
{" • "}
<a
href="/privacy"
className="underline hover:no-underline focus:outline-none focus:ring"
>
Privacy&nbsp;Policy
</a>
</div>
);
};
🤖 Prompt for AI Agents
In src/frontend/src/customization/components/custom-terms-links.tsx lines 1 to
3, the CustomTermsLinks component returns an empty fragment, resulting in no
visible UI. Replace the empty fragment with a minimal placeholder element or a
clear TODO comment inside the returned JSX to indicate that this component is a
stub for future design iteration.

Merged via the queue into main with commit 2242d75 Jul 1, 2025
29 of 34 checks passed
@Cristhianzl Cristhianzl deleted the cz/terms-custom branch July 1, 2025 15:02
lucaseduoli pushed a commit that referenced this pull request Jul 1, 2025
✨ (frontend): add CustomTermsLinks component to GeneralPage to display custom terms links in the settings page.
Khurdhula-Harshavardhan pushed a commit to JigsawStack/langflow that referenced this pull request Jul 1, 2025
✨ (frontend): add CustomTermsLinks component to GeneralPage to display custom terms links in the settings page.
ogabrielluiz pushed a commit that referenced this pull request Jul 2, 2025
✨ (frontend): add CustomTermsLinks component to GeneralPage to display custom terms links in the settings page.
jordanrfrazier pushed a commit that referenced this pull request Jul 3, 2025
✨ (frontend): add CustomTermsLinks component to GeneralPage to display custom terms links in the settings page.
ogabrielluiz pushed a commit that referenced this pull request Jul 3, 2025
✨ (frontend): add CustomTermsLinks component to GeneralPage to display custom terms links in the settings page.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants