From ed0825e661fccafb9269139e3593df1c0fc10405 Mon Sep 17 00:00:00 2001 From: Chris Coutinho Date: Sat, 15 Nov 2025 05:39:07 +0100 Subject: [PATCH] feat: Enhance vector visualization UI and parallelize search verification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Vector Visualization Improvements: - Add interactive vector viz tab with Alpine.js and Plotly.js to user info page - Refactor viz route CSS for better scoping and maintainability - Remove unused nextcloud_host variable Performance Optimizations: - Parallelize access verification in fuzzy and keyword search algorithms - Use asyncio.gather() to verify multiple documents concurrently - Add exception handling with return_exceptions=True for resilience Dependencies: - Update third_party/oidc submodule to include RFC 9728 resource_url support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- nextcloud_mcp_server/auth/userinfo_routes.py | 123 ++++++++- nextcloud_mcp_server/auth/viz_routes.py | 275 ++++++------------- nextcloud_mcp_server/search/fuzzy.py | 50 +++- nextcloud_mcp_server/search/keyword.py | 44 ++- third_party/oidc | 2 +- 5 files changed, 280 insertions(+), 214 deletions(-) diff --git a/nextcloud_mcp_server/auth/userinfo_routes.py b/nextcloud_mcp_server/auth/userinfo_routes.py index 50e17eb..ca33e2b 100644 --- a/nextcloud_mcp_server/auth/userinfo_routes.py +++ b/nextcloud_mcp_server/auth/userinfo_routes.py @@ -489,6 +489,16 @@ async def user_info_html(request: Request) -> HTMLResponse: str(request.url_for("oauth_logout")) if oauth_ctx else "/oauth/logout" ) + # Get Nextcloud host for generating links to apps (used by viz tab) + # Use public issuer URL if available (for browser-accessible links), + # otherwise fall back to NEXTCLOUD_HOST from settings + from nextcloud_mcp_server.config import get_settings + + settings = get_settings() + nextcloud_host_for_links = ( + os.getenv("NEXTCLOUD_PUBLIC_ISSUER_URL") or settings.nextcloud_host + ) + # Build host info HTML (BasicAuth only) host_info_html = "" if auth_mode == "basic": @@ -658,6 +668,115 @@ async def user_info_html(request: Request) -> HTMLResponse: + + + + + + - - -
-
-

Vector Visualization

-
+ +
+
+

Vector Visualization

+
Testing search algorithms on your indexed documents. User: {username}
-
+
-
+
-
-
+
+
@@ -252,12 +247,12 @@ async def vector_visualization_html(request: Request) -> HTMLResponse:
-
+
-
+
@@ -271,17 +266,17 @@ async def vector_visualization_html(request: Request) -> HTMLResponse:
- +
- +
- +
@@ -289,134 +284,44 @@ async def vector_visualization_html(request: Request) -> HTMLResponse:
-
-
- Executing search and computing PCA projection... +
+
+
+ Executing search and computing PCA projection... +
+
-
-
-

Search Results ()

-