Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make most major changes for an updated chat UI #843

Merged
merged 33 commits into from
Jul 14, 2024

Conversation

sabaimran
Copy link
Member

Screenshot 2024-07-09 at 19 49 06
  • Updated references panel
  • Use subtle coloring for chat cards
  • Chat streaming with train of thought
  • Side panel with limited sessions, expandable
  • Manage conversation file filters easily from the side panel
  • Updated nav menu, easily go to agents/automations/profile
  • Upload data from the chat UI (on click attachment icon)
  • Slash command pop-up menu, scrollable and selectable
  • Dark mode-enabled
  • Mostly mobile friendly

The speaker icon (to talk back) is still non-functional. Mic is still non-functional.

@sabaimran sabaimran requested review from debanjum and MythicalCow July 9, 2024 14:22
Copy link

gitguardian bot commented Jul 9, 2024

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
10005301 Triggered Generic Password bf4c2f2 src/khoj/app/settings.py View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

… from URL manually. See vercel/next.js#64660 for limitations with static export / dynamic routes
@sabaimran
Copy link
Member Author

sabaimran commented Jul 11, 2024

To test locally,

  1. Run yarn export from src/interface/web.
  2. Update file returned in relevant web_client.py APIs.

Sample code for local testing in web_client.py.

src/khoj/routers/web_client.py
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

─────────────────────────────────────────────────────────────────────────────────────┐
41: templates = Jinja2Templates([constants.web_directory, constants.next_js_director │
─────────────────────────────────────────────────────────────────────────────────────┘
@web_client.get("/", response_class=FileResponse)
@requires(["authenticated"], redirect="login_page")
def index(request: Request):
    return templates.TemplateResponse(
        "chat/index.html",
        context={
            "request": request,
        },
    )

    user = request.user.object
    user_picture = request.session.get("user", {}).get("picture")
    has_documents = EntryAdapters.user_has_entries(user=user)

─────────────────────────────────┐
68: def index(request: Request): │
─────────────────────────────────┘
@web_client.post("/", response_class=FileResponse)
@requires(["authenticated"], redirect="login_page")
def index_post(request: Request):
    return templates.TemplateResponse(
        "chat/index.html",
        context={
            "request": request,
        },
    )

    user = request.user.object
    user_picture = request.session.get("user", {}).get("picture")
    has_documents = EntryAdapters.user_has_entries(user=user)

────────────────────────────────────────┐
115: def search_page(request: Request): │
────────────────────────────────────────┘
@web_client.get("/chat", response_class=FileResponse)
@requires(["authenticated"], redirect="login_page")
def chat_page(request: Request):

    return templates.TemplateResponse(
        "chat/index.html",
        context={
            "request": request,
        },
    )

    user = request.user.object
    user_picture = request.session.get("user", {}).get("picture")
    has_documents = EntryAdapters.user_has_entries(user=user)

─────────────────────────────────────────────────┐
415: def computer_config_page(request: Request): │
─────────────────────────────────────────────────┘

@web_client.get("/share/chat/{public_conversation_slug}", response_class=HTMLResponse)
def view_public_conversation(request: Request):
    return templates.TemplateResponse(
        "share/chat/index.html",
        context={
            "request": request,
        },
    )

    public_conversation_slug = request.path_params.get("public_conversation_slug")
    public_conversation = PublicConversationAdapters.get_public_conversation_by_slug(public_conversation_slug)
    if not public_conversation:

@sabaimran sabaimran changed the base branch from master to features/big-upgrade-chat-ux July 14, 2024 17:46
@sabaimran sabaimran merged commit 06dce47 into features/big-upgrade-chat-ux Jul 14, 2024
6 checks passed
@sabaimran sabaimran deleted the features/chat-ui-updates-big branch July 14, 2024 17:48
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