Skip to content

Conversation

@nikochiko
Copy link
Member

Q/A checklist

  • I have tested my UI changes on mobile and they look acceptable
  • I have tested changes to the workflows in both the API and the UI
  • I have done a code review of my changes and looked at each line of the diff + the references of each function I have changed
  • My changes have not increased the import time of the server
How to check import time?

time python -c 'import server'

You can visualize this using tuna:

python3 -X importtime -c 'import server' 2> out.log && tuna out.log

To measure import time for a specific library:

$ time python -c 'import pandas'

________________________________________________________
Executed in    1.15 secs    fish           external
   usr time    2.22 secs   86.00 micros    2.22 secs
   sys time    0.72 secs  613.00 micros    0.72 secs

To reduce import times, import libraries that take a long time inside the functions that use them instead of at the top of the file:

def my_function():
    import pandas as pd
    ...

Legal Boilerplate

Look, I get it. The entity doing business as “Gooey.AI” and/or “Dara.network” was incorporated in the State of Delaware in 2020 as Dara Network Inc. and is gonna need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Dara Network Inc can use, modify, copy, and redistribute my contributions, under its choice of terms.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 15, 2025

📝 Walkthrough

Walkthrough

  • settings.py: Prepends (EXPLORE_URL, "Explore") to HEADER_LINKS.
  • routers/root.py: Removes explicit Explore link rendering when show_search_bar is False and from the anonymous login popover; other links still sourced from settings.HEADER_LINKS.
  • workspaces/widgets.py: Drops direct import/use of explore_page and the hard-coded small-screen Explore link. Iterates over settings.HEADER_LINKS (with settings.HEADER_ICONS) to render small-screen header links, then adds a Saved link and keeps logout.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • devxpy

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description includes the repository template sections (Q/A checklist, import-time guidance, and legal boilerplate) but all four checklist items remain unchecked and there is no test evidence, screenshots, or a concise human-readable summary of the functional changes. Because the checklist is intended to document completed testing (mobile UI, API/UI workflows), code review, and import-time verification, leaving these items unchecked means required validation evidence is missing for reviewers. Therefore the description is incomplete for a pre-merge review. Please complete the Q/A checklist with concrete evidence: include mobile UI test notes or screenshots, API/UI workflow test results, confirmation that a code review was performed, and import-time measurement output (or a statement that import time was measured and unchanged). Also add a short plain-language summary of the functional changes, the files touched, and any user-visible impacts or rollout/migration notes so reviewers can assess risk before merging.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The title "feat: add explore link in header" succinctly describes the primary change in this PR: adding (EXPLORE_URL, "Explore") to daras_ai_v2/settings.py and updating header rendering in routers/root.py and workspaces/widgets.py so the Explore link appears consistently. It is concise, focused, and directly reflects the raw_summary of modified files and behavior. No extraneous wording or emojis are present, so a teammate scanning history will understand the main intent.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch explore-button-in-desktop

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
daras_ai_v2/settings.py (1)

295-303: Allow EXPLORE_URL override — avoid domain drift

Add an EXPLORE_URL env override (fallback to the computed value) and standardize all Explore links to use EXPLORE_URL or a relative "/explore/" instead of baking domains from APP_BASE_URL.

-EXPLORE_URL = furl(APP_BASE_URL).add(path="explore").url
+# Allow override to avoid domain drift in mixed FE/BE environments.
+EXPLORE_URL = config(
+    "EXPLORE_URL",
+    default=furl(APP_BASE_URL).add(path="explore").url,
+)

Files/locations to update (found by grep): daras_ai_v2/settings.py:295 (apply diff), templates/footer.html ("/explore/"), routers/root.py (DEFAULT_LOGIN_REDIRECT, paths list, @gui.route("/explore/")), daras_ai_v2/base.py (gui.link(to="/explore/")), payments/plans.py (href="/explore"), scripts/test_wa_msg_send.py (hard-coded https://gooey.ai/explore/), README.md/Home.py (external explore links) — replace absolute or separately-constructed Explore URLs with EXPLORE_URL or use relative paths.

🧹 Nitpick comments (3)
daras_ai_v2/settings.py (1)

301-308: Nit: keep link paths consistent (trailing slash policy).

HEADER_LINKS mixes "/api/" (with slash) and "/pricing" (without). Pick one convention to avoid accidental double‑redirects in some proxies/CDNs.

workspaces/widgets.py (2)

144-151: Icon lookup keyed by URL is brittle across envs; key by label instead.

URLs can be absolute or relative depending on config, breaking the map. Labels are stable.

Apply this diff:

-            for url, label in settings.HEADER_LINKS:
+            for url, label in settings.HEADER_LINKS:
                 workspace_selector_link(
                     url=url,
                     label=label,
-                    icon=settings.HEADER_ICONS.get(url),
+                    icon=settings.HEADER_ICONS.get(label),
                 )

Follow‑up: populate HEADER_ICONS with label keys (e.g., {"Explore": ""}). Avoid importing icons into settings to prevent reverse deps; keep raw icon HTML strings there or move the mapping next to this widget.


171-176: Open external links in a new tab with rel=noopener to avoid context loss and tab‑nabbing.

Small‑screen popover now includes external links (Docs/Blog/Contact). Prefer new tab.

Apply this diff:

 def workspace_selector_link(
     url: str,
     label: str,
     caption: str | None = None,
     icon: str | None = None,
     row_height: str = "2.2rem",
 ):
-    with gui.tag(
+    is_external = url.startswith("http://") or url.startswith("https://")
+    extra_attrs = dict(target="_blank", rel="noopener") if is_external else {}
+    with gui.tag(
         "a",
         href=url,
+        **extra_attrs,
         className="text-decoration-none d-block bg-hover-light align-items-center px-3 my-1 py-1",
         style=dict(height=row_height),
     ):
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 83a37d4 and a82f18f.

📒 Files selected for processing (3)
  • daras_ai_v2/settings.py (1 hunks)
  • routers/root.py (0 hunks)
  • workspaces/widgets.py (1 hunks)
💤 Files with no reviewable changes (1)
  • routers/root.py
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: nikochiko
PR: GooeyAI/gooey-server#703
File: daras_ai_v2/settings.py:301-308
Timestamp: 2025-06-16T11:42:40.993Z
Learning: In daras_ai_v2/settings.py, when using a localhost frontend with api.gooey.ai backend deployment, hard-coded "/explore/" paths work correctly as relative URLs, but EXPLORE_URL computed from APP_BASE_URL may point to the wrong domain (localhost instead of api.gooey.ai).
📚 Learning: 2025-06-16T11:42:40.993Z
Learnt from: nikochiko
PR: GooeyAI/gooey-server#703
File: daras_ai_v2/settings.py:301-308
Timestamp: 2025-06-16T11:42:40.993Z
Learning: In daras_ai_v2/settings.py, when using a localhost frontend with api.gooey.ai backend deployment, hard-coded "/explore/" paths work correctly as relative URLs, but EXPLORE_URL computed from APP_BASE_URL may point to the wrong domain (localhost instead of api.gooey.ai).

Applied to files:

  • daras_ai_v2/settings.py
🧬 Code graph analysis (1)
workspaces/widgets.py (1)
routers/root.py (1)
  • logout (175-177)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Analyze (python)
  • GitHub Check: test (3.10.12, 1.8.3)
🔇 Additional comments (1)
workspaces/widgets.py (1)

27-27: Import cleanup looks good.

Dropping the unused explore import (now data‑driven) reduces coupling and potential cycles.

@nikochiko nikochiko merged commit bd158e6 into master Sep 16, 2025
8 checks passed
@nikochiko nikochiko deleted the explore-button-in-desktop branch September 16, 2025 08:12
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.

3 participants