Commit graph

54 commits

Author SHA1 Message Date
LUIS NOVO
cb525148e3 fix: add type assertion for experimental proxyClientMaxBodySize config
Next.js 15 accepts proxyClientMaxBodySize at runtime but TypeScript types
for ExperimentalConfig don't include it yet, causing build failures.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 20:44:43 -03:00
LUIS NOVO
6593ab561a fix: increase Next.js proxy body size limit for file uploads
Increase the proxyClientMaxBodySize from 10MB (default) to 100MB to allow
larger files to be uploaded through the /api/* rewrite proxy to FastAPI.

Fixes #361
2026-01-09 20:18:06 -03:00
LUIS NOVO
a41703fbac chore: remove unused AddButton component
The AddButton component was never imported or used anywhere in the
application. Notebook creation is already implemented and working via:
- "New Notebook" button on the notebooks page
- "Create" button in the sidebar
- "Create Notebook" command in the command palette

Closes #390
2026-01-08 15:56:26 -03:00
LUIS NOVO
71b8d13b24 docs: generate comprehensive CLAUDE.md reference documentation across codebase
Create a hierarchical CLAUDE.md documentation system for the entire Open Notebook
codebase with focus on concise, pattern-driven reference cards rather than
comprehensive tutorials.

## Changes

### Core Documentation System
- Updated `.claude/commands/build-claude-md.md` to distinguish between leaf and
  parent modules, with special handling for prompt/template modules
- Established clear patterns:
  * Leaf modules (40-70 lines): Components, hooks, API clients
  * Parent modules (50-150 lines): Architecture, cross-layer patterns, data flows
  * Template modules: Pattern focus, not catalog listings

### Generated Documentation
Created 15 CLAUDE.md reference files across the project:

**Frontend (React/Next.js)**
- frontend/src/CLAUDE.md: Architecture overview, data flow, three-tier design
- frontend/src/lib/hooks/CLAUDE.md: React Query patterns, state management
- frontend/src/lib/api/CLAUDE.md: Axios client, FormData handling, interceptors
- frontend/src/lib/stores/CLAUDE.md: Zustand state persistence, auth patterns
- frontend/src/components/ui/CLAUDE.md: Radix UI primitives, CVA styling

**Backend (Python/FastAPI)**
- open_notebook/CLAUDE.md: System architecture, layer interactions
- open_notebook/ai/CLAUDE.md: Model provisioning, Esperanto integration
- open_notebook/domain/CLAUDE.md: Data models, ObjectModel/RecordModel patterns
- open_notebook/database/CLAUDE.md: Repository pattern, async migrations
- open_notebook/graphs/CLAUDE.md: LangGraph workflows, async orchestration
- open_notebook/utils/CLAUDE.md: Cross-cutting utilities, context building
- open_notebook/podcasts/CLAUDE.md: Episode/speaker profiles, job tracking

**API & Other**
- api/CLAUDE.md: REST layer, service architecture
- commands/CLAUDE.md: Async command handlers, job queue patterns
- prompts/CLAUDE.md: Jinja2 templates, prompt engineering patterns (refactored)

**Project Root**
- CLAUDE.md: Project overview, three-tier architecture, tech stack, getting started

### Key Features
- Zero duplication: Parent modules reference child CLAUDE.md files, don't repeat them
- Pattern-focused: Emphasizes how components work together, not component catalogs
- Scannable: Short bullets, code examples only when necessary (1-2 per file)
- Practical: "How to extend" guides, quirks/gotchas for each module
- Navigation: Root CLAUDE.md acts as hub pointing to specialized documentation

### Cleanup
- Removed unused `batch_fix_services.py`
- Removed deprecated `open_notebook/plugins/podcasts.py`
- Updated .gitignore for documentation consistency

## Impact
New contributors can now:
1. Read root CLAUDE.md for system architecture (5 min)
2. Jump to specific layer documentation (frontend, api, open_notebook)
3. Dive into module-specific patterns in child CLAUDE.md files (1 min per module)
All documentation is lean, reference-focused, and avoids duplication.
2026-01-03 16:27:52 -03:00
Luis Novo
93cda6c42a
Merge pull request #304 from xeader/fix/issue-271.2-ui-not-responsive
feat(notebooks): improve layout responsiveness
2025-12-20 10:18:22 -03:00
LUIS NOVO
2a4d98772b fix(ui): optimize MutationObserver in NoteEditorDialog
Only observe DOM mutations when dialog is open, preventing
unnecessary observer activity when the dialog is closed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 10:13:49 -03:00
Luis Novo
a8bb88e10f
Merge pull request #305 from xeader/fix/issue-271.1-note-editor-not-full-screen
feat(notebooks): Enhance dialog content styling for fullscreen mode
2025-12-20 10:12:29 -03:00
Antonio Gatta
cdb074193f feat: support fullscreen mode in NoteEditorDialog
- Added `isEditorFullscreen` state to track fullscreen mode for the Markdown editor.
- Integrated `MutationObserver` to detect changes related to the `.w-md-editor-fullscreen` class.
- Adjusted dialog and editor styles dynamically based on fullscreen state using `cn`.
- Enhanced UX by resetting fullscreen state on dialog close.
2025-12-20 11:38:31 +01:00
LUIS NOVO
79f4d5ea6a fix: resolve merge conflict in SourceInsightDialog
Add missing state variables and handlers for delete functionality
that were lost during merge of PRs #334 and #340
2025-12-19 23:10:49 -03:00
Luis Novo
c41cc074b5
Merge branch 'main' into feat/delete-insight 2025-12-19 22:50:53 -03:00
Luis Novo
8fdb0f0539
Update frontend/src/components/source/SourceDetailContent.tsx
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-12-19 22:48:09 -03:00
Justin Florentine
c7de8ecd86
fix: address PR feedback for delete insight feature
- Fix AlertDialogAction closing before async delete completes by using
  asChild with Button and event.preventDefault()
- Add delete button to SourceInsightDialog header for consistent UX
- Add confirmation dialog in SourceInsightDialog
- Pass onDelete callback from SourceDetailContent to SourceInsightDialog

Addresses PR #334 feedback from lfnovo and cubic-dev-ai.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 20:45:11 -05:00
LUIS NOVO
7f19c916ae feat: add View Source button to insight modal
- Add button to navigate from insight popup to its parent source
- Uses existing modal manager to open source detail view
- Shows button only when source_id is available
2025-12-19 17:10:55 -03:00
LUIS NOVO
a1d0a3a666 fix: allow model override before chat session exists
- Add pendingModelOverride state to useNotebookChat hook
- Store model selection when no session exists yet
- Apply pending model override when session is auto-created on first message
- Simplify ChatColumn by using new setModelOverride function
2025-12-19 16:55:26 -03:00
LUIS NOVO
e11f0a4db8 fix: resolve chat model selection and session display issues
- Add nullable_fields support to ObjectModel base class
- Configure ChatSession to allow model_override to be cleared to null
- Fix JSX conditional that rendered "0" when message_count was 0
- Display model name instead of raw ID in session manager

Fixes issues:
1. Switching to default model now persists correctly
2. Session list shows human-readable model names
3. Sessions with 0 messages no longer show "0" badge
2025-12-19 16:47:34 -03:00
Justin Florentine
8644f1923c
feat: add delete insight functionality
Add ability to delete insights from sources with a confirmation dialog.
Uses AlertDialog component for a native React experience instead of
browser confirm().

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 18:04:41 -05:00
LUIS NOVO
26e989fdbb fix: query key consistency and timeout configuration
- Use QUERY_KEYS.sourcesInfinite for infinite scroll query key
  Starting with ['sources', ...] ensures mutations that invalidate
  ['sources'] will also invalidate the infinite scroll cache

- Use httpx.Timeout for chat service with short connect (10s) and
  long read (600s) timeouts. Prevents 10 min wait on connection errors
2025-12-14 21:55:38 -03:00
LUIS NOVO
6e8f46420a feat(ui): add markdown table rendering support
Added remark-gfm plugin to enable GitHub Flavored Markdown support,
which includes proper table rendering. Updated all ReactMarkdown
usages with table styling components:

- ChatPanel (source and notebook chat)
- StreamingResponse (search/ask results)
- SourceInsightDialog
- SourceDetailContent
- TransformationPlayground

Tables now render with proper borders, headers with background,
and horizontal scroll for wide tables.
2025-12-14 12:01:28 -03:00
LUIS NOVO
ef6274c83a Merge remote-tracking branch 'origin/main' into feat/ui-improv 2025-12-14 11:47:43 -03:00
LUIS NOVO
3001537aa7 fix: increase timeout for Ollama and local LLM operations
Users with Ollama reported timeout errors on notebook chat while the
backend was still processing. The answer would appear after refresh.

- Frontend axios timeout: 5 min → 10 min
- Backend chat service timeout: 2 min → 10 min

Local LLMs can take several minutes for complex questions with large
contexts, especially on slower hardware.
2025-12-14 11:31:03 -03:00
LUIS NOVO
e5eeb90341 feat(ui): add infinite scroll for notebook sources
Previously, notebook sources were limited to 50 items due to API default.
This adds pagination with infinite scroll to the sources column:

- Add useNotebookSources hook with useInfiniteQuery for paginated fetching
- Update SourcesColumn with scroll detection to load more sources
- Fetch 30 sources per page, loading more as user scrolls near bottom
2025-12-14 10:56:38 -03:00
dependabot[bot]
3b7d99a687
chore(deps): bump next from 15.4.9 to 15.4.10 in /frontend
Bumps [next](https://github.com/vercel/next.js) from 15.4.9 to 15.4.10.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v15.4.9...v15.4.10)

---
updated-dependencies:
- dependency-name: next
  dependency-version: 15.4.10
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-14 13:11:44 +00:00
dependabot[bot]
64212814cc
chore(deps): bump next from 15.4.8 to 15.4.9 in /frontend
Bumps [next](https://github.com/vercel/next.js) from 15.4.8 to 15.4.9.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v15.4.8...v15.4.9)

---
updated-dependencies:
- dependency-name: next
  dependency-version: 15.4.9
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-12 00:44:15 +00:00
Antonio Gatta
45ac425484 feat: enhance dialog content for fullscreen mode
- Added styles to ensure `.w-md-editor-fullscreen` behaves statically and adjusts height dynamically with `!static` and `!h-[calc(90vh-(var(--spacing)*41))]`.
2025-12-08 02:18:07 +01:00
Antonio Gatta
eb67e33965 feat: improve dialog content responsive styling
- Added support for `.w-md-editor-fullscreen` class to dynamically adjust height and width for fullscreen mode.
2025-12-08 01:41:05 +01:00
Antonio Gatta
47db332d17 feat(notebooks): improve layout responsiveness
- Adjusted `div` class styles to add horizontal scrolling in smaller viewports (`overflow-x-auto`).
- Updated chat column element with additional padding and margin adjustments for better desktop layout.
2025-12-08 00:24:37 +01:00
Luis Novo
8644e995f1
Merge pull request #290 from lfnovo/dependabot/npm_and_yarn/frontend/mdast-util-to-hast-13.2.1
chore(deps): bump mdast-util-to-hast from 13.2.0 to 13.2.1 in /frontend
2025-12-06 08:25:57 -03:00
dependabot[bot]
8ad38bf1b1
chore(deps): bump next from 15.4.7 to 15.4.8 in /frontend
Bumps [next](https://github.com/vercel/next.js) from 15.4.7 to 15.4.8.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v15.4.7...v15.4.8)

---
updated-dependencies:
- dependency-name: next
  dependency-version: 15.4.8
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-03 20:45:51 +00:00
dependabot[bot]
647f60d197
chore(deps): bump mdast-util-to-hast from 13.2.0 to 13.2.1 in /frontend
Bumps [mdast-util-to-hast](https://github.com/syntax-tree/mdast-util-to-hast) from 13.2.0 to 13.2.1.
- [Release notes](https://github.com/syntax-tree/mdast-util-to-hast/releases)
- [Commits](https://github.com/syntax-tree/mdast-util-to-hast/compare/13.2.0...13.2.1)

---
updated-dependencies:
- dependency-name: mdast-util-to-hast
  dependency-version: 13.2.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-02 04:05:47 +00:00
LUIS NOVO
d8e61c6b5b fix(ui): address review feedback for URL param handling
- Fix race condition: only set hasAutoTriggeredRef after successful execution
- Add URL mode validation: ensure mode is either 'search' or 'ask'
2025-12-01 20:52:35 -03:00
LUIS NOVO
33be80ab7c fix(ui): handle URL params in search page for command palette navigation
The search page now reads `q` and `mode` query parameters from the URL,
enabling proper integration with the command palette's search/ask actions.

Changes:
- Read URL params using useSearchParams hook
- Initialize form fields and active tab from URL params
- Auto-trigger search/ask when arriving with URL params
- Handle subsequent navigations while on the search page
2025-12-01 20:46:49 -03:00
Luis Novo
5d5b6bd035
feat(ui): add command palette for quick navigation and search (#288)
* feat(ui): add command palette for quick navigation and search

Replace top bar search with a command palette (⌘K / Ctrl+K) that provides:
- Quick navigation to all app sections
- Create shortcuts for sources, notebooks, and podcasts
- Theme switching (light/dark/system)
- Search and Ask functionality for non-matching queries

This approach saves screen real estate while providing faster access
to common actions through keyboard shortcuts.

Co-authored-by: EmbroiderSnow <1497411439@qq.com>

* chore: bump to 1.2.3

* feat(command-palette): add notebook quick navigation

Users can now type a notebook name in the command palette (⌘K) to
navigate directly to that notebook. Shows up to 8 most recent
notebooks, with cmdk filtering all notebooks when typing.

* fix(command-palette): address code review issues

- Skip ⌘K/Ctrl+K shortcut when focus is inside input, textarea, select,
  or contentEditable elements to preserve native keyboard handling
- Remove 8-item limit on notebooks so all notebooks are searchable
  via cmdk filtering

* perf(command-palette): memoize command matching and add platform shortcuts

- Memoize hasCommandMatch computation with useMemo to avoid
  recalculating on every render
- Show platform-specific keyboard shortcut in sidebar hint:
  ⌘K on macOS, Ctrl+K on Windows/Linux

* fix(command-palette): add spinner to notebooks loading state

Show a spinning Loader2 icon alongside the "Loading notebooks..." text
for clearer visual feedback when the command palette is fetching data.

---------

Co-authored-by: EmbroiderSnow <1497411439@qq.com>
2025-12-01 14:59:17 -03:00
dependabot[bot]
2084b04f4d
chore(deps-dev): bump js-yaml from 4.1.0 to 4.1.1 in /frontend (#263)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.1.0 to 4.1.1.
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/4.1.0...4.1.1)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 4.1.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-27 11:36:56 -03:00
Luis Novo
45a99831a9
Hide sources notes (#273)
* fix: add missing overflow wrapper to notebooks list page

Adds flex-1 overflow-y-auto wrapper to enable proper scrolling
when notebook list exceeds viewport height. Matches the layout
pattern used by all other dashboard pages.

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: reorder transformation routes to prevent dynamic route interception

Moved static routes (/transformations/execute and /transformations/default-prompt)
before dynamic routes (/transformations/{transformation_id}) to ensure FastAPI
matches them correctly. Previously, requests to static routes were incorrectly
captured by the dynamic route handler.

Fixes #250

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: bump to 1.2.1

* hide source and notes panel - fixes #193

* feat: improve layout for mobile views

* bump version to 1.2.2

* fix: address PR review feedback for collapsible columns

- Remove unused CollapseButton component from CollapsibleColumn.tsx
- Rename useCollapseButton to createCollapseButton (not a React hook)
- Move dialogs outside Card in SourcesColumn.tsx for consistency
- Add useMemo for collapseButton in both columns to prevent re-renders

* feat: support multiple sources

* fix: prevent ChatColumn double mounting on desktop

Add useIsDesktop hook to conditionally render mobile view only on
mobile screens. Previously, the mobile ChatColumn was hidden via CSS
on desktop but still mounted, causing duplicate hooks initialization
and redundant network requests.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-25 16:59:26 -03:00
Luis Novo
b42cc06e65
fix: UI scrolling and API route ordering issues (#253)
* fix: add missing overflow wrapper to notebooks list page

Adds flex-1 overflow-y-auto wrapper to enable proper scrolling
when notebook list exceeds viewport height. Matches the layout
pattern used by all other dashboard pages.

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: reorder transformation routes to prevent dynamic route interception

Moved static routes (/transformations/execute and /transformations/default-prompt)
before dynamic routes (/transformations/{transformation_id}) to ensure FastAPI
matches them correctly. Previously, requests to static routes were incorrectly
captured by the dynamic route handler.

Fixes #250

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: bump to 1.2.1

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-04 21:15:00 -03:00
Luis Novo
f79a9040ae
Release 1.2 (#242)
* chore: improve podcast transcripts

* fix: remove date from insight - fixes #241

* fix: improve scrolling on source and insights - fixes #237

* chore: update esperanto to fix: #234

* chore: update esperanto to fix #226

* fix: process vectorization as subcommands to handle larger documents more gracefully - fix: #229

* feat: enable background job retry capabilities

* feat: reenable content types that were disabled during alpha version

* fix: remove unnecessary model caching causing many issues.

* feat: support multiple azure endpoints and keys just like openai compatible. Fixes #215

* docs: update azure variables

* chore: bump and update dependencies
2025-11-01 14:40:00 -03:00
Luis Novo
933de75b73
feat: implement compact chat references with numbered citations (#220)
Transform verbose inline references to compact footnote-style format:
- Replace [source:abc123] with numbered citations [1], [2], etc.
- Add "References:" section at bottom of messages
- Deduplicate references (same ID gets same number)
- Remove icons from citations for cleaner appearance
- Maintain click-to-open functionality for all reference types

Changes:
- Add convertReferencesToCompactMarkdown() function
- Add createCompactReferenceLinkComponent() function
- Update ChatPanel to use new compact reference functions
- Add ReferenceData interface for type safety

Improves readability by reducing visual clutter while preserving
all existing functionality. References restart numbering at 1 for
each message.
2025-10-25 10:26:21 -03:00
Luis Novo
a287d3b248
refactor: optimize duplicate model validation and improve error handling (#219)
* feat: prevent duplicate model names under same provider

Implement case-insensitive validation to prevent users from creating
duplicate model names under the same provider. This validation is
implemented both in the backend API and the frontend UI.

Changes:
- Backend: Add duplicate check in create_model endpoint (case-insensitive)
- Frontend: Add client-side validation in AddModelForm
- Frontend: Improve error message display from backend
- Tests: Add unit tests for duplicate model validation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor: optimize duplicate model validation and improve error handling

- Replace O(n) model iteration with efficient SurrealDB query for duplicate check
- Improve error message to include model name and provider for better UX
- Remove frontend duplicate validation (backend-only enforcement)
- Fix test authentication by setting OPEN_NOTEBOOK_PASSWORD before imports
- Update test mocking to use repo_query instead of Model.get_all()
- Add pytest fixture for TestClient to ensure proper test isolation

All 11 tests passing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* remove unnecessary package

* fix: replace any with unknown type in error handler

- Change error type from 'any' to 'unknown' to satisfy ESLint
- Add proper type assertion for error object structure
- Maintains same runtime behavior with better type safety

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-25 08:48:18 -03:00
Luis Novo
a0a2282bfa
Delete note functionality (#216)
* feat: Enable note deletion.

* enable dismissing the upgrade button

* delete notes

* fix chat session dialog error

* chore: bump

* chore: bump correctly
2025-10-24 18:27:02 -03:00
Luis Novo
9bdfd99f1b
feat: simplify reverse proxy configuration with Next.js rewrites (#213)
* feat: simplify reverse proxy configuration with Next.js rewrites

Add Next.js API rewrites to proxy /api/* requests internally from port 8502
to the FastAPI backend on port 5055. This eliminates the need for complex
reverse proxy configurations with multiple upstreams and location blocks.

Changes:
- Add rewrites to next.config.ts proxying /api/* to INTERNAL_API_URL
- Introduce INTERNAL_API_URL env var (defaults to http://localhost:5055)
- Update supervisord configs to pass INTERNAL_API_URL to Next.js
- Document INTERNAL_API_URL in .env.example with usage examples
- Add simplified reverse proxy examples for nginx, Traefik, Caddy, Coolify
- Update README architecture diagram to show internal proxying
- Add explanatory comments to _config route handler

Benefits:
- Reduces reverse proxy config from 12 lines to 3 (75% reduction)
- Single-port deployment (8502 only) for 95% of use cases
- Zero breaking changes - backward compatible with existing setups
- Zero performance overhead (validated through testing)
- Preserves proxy headers (X-Forwarded-*) for rate limiting/SSL

Resolves: #179
Related: OSS-321

* fix: rename _config to config to fix production routing

CRITICAL BUG FIX: The /_config endpoint has never worked in production builds
because Next.js treats folders starting with underscore as "private folders"
and excludes them from routing entirely.

This endpoint is critical for:
- Providing API_URL to the browser at runtime
- Enabling zero-config deployments with auto-detection
- Supporting reverse proxy scenarios where API URL differs from frontend URL

Changes:
- Rename frontend/src/app/_config/ → frontend/src/app/config/
- Update client code references (/_config → /config)
- Update documentation with correct endpoint path
- Bump version to 1.1.0 (minor version for new rewrites feature + bug fix)

Impact:
- Runtime configuration now works in production builds
- /config returns {"apiUrl":"http://localhost:5055"} correctly
- Auto-detection for reverse proxy deployments now functional

Related: #179, OSS-321

* fix: resolve React hook exhaustive-deps warning in AddExistingSourceDialog

Wrap performSearch function in useCallback to properly memoize it and satisfy
React Hook exhaustive-deps rule. This prevents unnecessary re-renders and
ensures the useEffect dependency array is correctly specified.

Changes:
- Import useCallback from React
- Wrap performSearch with useCallback([debouncedSearchQuery, allSources])
- Add performSearch to useEffect dependency array

* final fixes
2025-10-24 11:24:14 -03:00
Luis Novo
d680a0affc
docs: update model help links to point to ai-models documentation (#212)
Updated help links in DefaultModelsSection and ProviderStatus components
to point to the new AI models documentation location at
docs/features/ai-models.md instead of docs/models.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-23 18:14:24 -03:00
Luis Novo
fc8a4a0c64
fix: resolve API_URL config routing conflict with reverse proxies (#191)
Move runtime configuration endpoint from /api/runtime-config to /_config to avoid
conflicts with reverse proxies that route all /api/* requests to the FastAPI backend.

This fixes an issue where users with reverse proxies would see port 5055 incorrectly
appended to their API_URL even when explicitly set via environment variable.

Changes:
- Move frontend/src/app/api/runtime-config/route.ts to frontend/src/app/_config/route.ts
- Update config.ts to fetch from /_config instead of /api/runtime-config
- Add troubleshooting documentation for reverse proxy users
- Update all reverse proxy examples to show correct routing (catch-all handles /_config)
- Bump version to 1.0.11

The new /_config endpoint is automatically handled by standard reverse proxy catch-all
rules (location / { proxy_pass http://frontend; }), requiring no additional configuration
for most users.

Fixes issue where API_URL environment variable was being ignored in reverse proxy setups,
causing CORS errors with "Status code: (null)" and incorrect port 5055 being added.
2025-10-21 12:06:24 -03:00
LUIS NOVO
a9af195485 fix: set version cache to 24hrs 2025-10-19 18:05:04 -03:00
Luis Novo
992442150e
feat: add ability to link existing sources to notebooks (OSS-311) (#177)
* fix: small issue where users cant change podcast segments

* chore: remove playwright mcp from gut

* feat: add ability to link existing sources to notebooks (OSS-311)

Implemented bidirectional source-notebook linking functionality:

Backend changes:
- Add POST endpoint to link sources to notebooks
- Include notebook associations in source detail response
- Implement idempotent linking with proper RecordID handling

Frontend changes:
- Add AddExistingSourceDialog with search and multi-select
- Add NotebookAssociations component for source detail view
- Add dropdown menu to "Add Source" button (new/existing)
- Implement useAddSourcesToNotebook hook with graceful error handling
- Fix dialog pointer-events during close animation
- Add loading states and disable checkboxes for linked sources
- Optimize dialog width with proper responsive breakpoints

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: address PR review feedback

- Fix sources.py query to use correct reference direction (OUT where IN)
- Remove debug console.log statements
- Add truncation warning for 100+ source lists

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-19 17:52:14 -03:00
Luis Novo
df0986cee0
Feature/oss 312 notebook item counts (#175)
* fix: small issue where users cant change podcast segments

* feat: display source and note counts on notebook cards (OSS-312)

Add item counters to notebook listing page showing the number of sources
and notes in each notebook. Counts are displayed in a footer section with
FileText and StickyNote icons for visual consistency with ContextIndicator.

Backend changes:
- Add source_count and note_count to NotebookResponse model
- Update /notebooks endpoint to use SurrealDB graph traversal query
- Query: count(<-reference.in) for sources, count(<-artifact.in) for notes
- Update all notebook endpoints to include counts

Frontend changes:
- Add source_count and note_count to TypeScript NotebookResponse interface
- Add footer section to NotebookCard component
- Display counts with FileText and StickyNote icons (h-3 w-3)
- Use border-top separator and muted-foreground styling

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* style: use colorful badges for notebook counts matching ContextIndicator

Update notebook card counts to use Badge components with primary color
styling instead of plain text, matching the visual style of the
ContextIndicator component in the chat window.

Changes:
- Replace plain text divs with Badge components
- Apply text-primary and border-primary/50 styling
- Use same spacing (gap-1.5, px-1.5, py-0.5) as ContextIndicator
- Remove bullet separator (not needed with badge layout)

Visual result matches the colorful badges shown in chat context.

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-19 16:03:36 -03:00
Luis Novo
1a67f1f912
fix: enhance chat reference links and prevent text overflow (#173)
This commit addresses two related issues in the chat interface:

1. **Fix broken reference links (OSS-310)**
   - Completely rewrote convertReferencesToMarkdownLinks() with greedy pattern matching
   - Now handles all edge cases: references after commas, nested brackets, bold markdown
   - Added visual icon indicators (FileText, Lightbulb, FileEdit) for reference types
   - Implemented proper error handling with toast notifications
   - Added validation for reference types and ID lengths

2. **Fix long URL/text overflow (#172)**
   - Added break-words and overflow-wrap classes to chat messages
   - Long URLs and text now wrap properly within chat bubbles
   - Applied fix consistently across source chat, notebook chat, and search results

**Technical Details:**
- Enhanced reference detection algorithm processes from end to start to preserve indices
- Context analysis (50 chars before/after) determines original formatting
- Icons are 12px, accessible, and themed appropriately
- All changes pass linting and build successfully

**Files Modified:**
- frontend/src/lib/utils/source-references.tsx (core algorithm rewrite)
- frontend/src/components/source/ChatPanel.tsx (error handling + text wrapping)
- frontend/src/components/search/StreamingResponse.tsx (error handling + text wrapping)
- open_notebook/utils/token_utils.py (ruff formatting fix)

fixes #172
2025-10-19 15:38:59 -03:00
Luis Novo
b5666c4d68
Fix/increase fix: increase API client timeouts for transformation operations timeouts (#170)
* fix: increase API client timeouts for transformation operations

- Increase frontend timeout from 30s to 300s (5 minutes)
- Increase Streamlit API client timeout from 30s to 300s
- Add API_CLIENT_TIMEOUT environment variable for configurability
- Add ESPERANTO_LLM_TIMEOUT environment variable documentation
- Update .env.example with comprehensive timeout documentation

Fixes #131 - API timeout errors during transformation generation
Transformations now have sufficient time to complete on slower
hardware (Ollama, LM Studio) without frontend timeout errors.

Users can now configure timeouts for both the API client layer
(API_CLIENT_TIMEOUT) and the LLM provider layer (ESPERANTO_LLM_TIMEOUT)
to accommodate their specific hardware and network conditions.

* docs: add timeout configuration documentation

- Add comprehensive timeout troubleshooting section to common-issues.md
- Add FAQ entry about timeout errors during transformations
- Document API_CLIENT_TIMEOUT and ESPERANTO_LLM_TIMEOUT usage
- Provide specific timeout recommendations for different hardware/network scenarios
- Link to GitHub issue #131 for reference

* chore: bump

* refactor: improve timeout configuration with validation and consistency

Based on PR review feedback, this commit addresses several improvements:

**Timeout Validation:**
- Add validation to ensure timeout values are between 30s and 3600s
- Invalid values fall back to default 300s with warning logs
- Handles edge cases (negative, zero, invalid strings)

**Fix Hard-coded Timeouts:**
- Replace all hard-coded timeout values in api/client.py
- ask_simple: 300s → self.timeout
- execute_transformation: 120s → self.timeout
- embed_content: 120s → self.timeout
- create_source: 300s → self.timeout
- rebuild_embeddings: Uses smart logic (2x timeout, max 3600s)

**Improved Documentation:**
- Add clarifying comments about ms vs seconds (frontend vs backend)
- Document that frontend uses 300000ms = backend 300s
- Add inline documentation for rebuild_embeddings timeout logic

**Development Dependencies:**
- Add pytest>=8.0.0 to dev dependencies for future test coverage

This makes timeout configuration more robust, consistent, and user-friendly
while maintaining backward compatibility.
2025-10-19 11:37:24 -03:00
LUIS NOVO
a73ce8e094 fix: better fix to the backend connectivity problem using the react backend for guessing the API URL 2025-10-19 10:16:58 -03:00
Luis Novo
04b5a9c96a
Implement a serverside fix for reverse proxy users (#169) 2025-10-19 08:02:21 -03:00
Luis Novo
8829eb40c5
Retire streamlit (#166)
* fix text

* remove lint from docker publish workflow

* remove streamlit app
2025-10-18 22:56:46 -03:00