Skip to content

feat(local): gate egress-sensitive actions and refactor studio source selection - #1807

Merged
AnishSarkar22 merged 8 commits into
MODSetter:devfrom
AnishSarkar22:feat/local-model-catalog
Sep 17, 2026
Merged

AnishSarkar22 merged 8 commits into
MODSetter:devfrom
AnishSarkar22:feat/local-model-catalog

Conversation

@AnishSarkar22

@AnishSarkar22 AnishSarkar22 commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Description

  • Lifted document/source selection into shared workspace state, replacing the inline source checklist with a drill-down sub-view in Studio
  • Gated the model catalog's own download and manual update checks behind egress consent, so both respect network permission settings consistently
  • Marked the remove-speaker action as destructive and labeled the Updates section clearly for users
  • Fixed long source lists overflowing dialogs by making them scrollable
  • Extracted the podcast form's native select into a shared component and bumped list header text size for consistency
  • Fixed the chats dialog's scroll fade to match its actual background color
  • Fixed the network settings checkbox's label association for accessibility (Biome noLabelWithoutControl)

Motivation and Context

FIX #

Screenshots

API Changes

  • This PR includes API changes

Change Type

  • Bug fix
  • New feature
  • Performance improvement
  • Refactoring
  • Documentation
  • Dependency/Build system
  • Breaking change
  • Other (specify):

Testing Performed

  • Tested locally
  • Manual/QA verification

Checklist

  • Follows project coding standards and conventions
  • Documentation updated as needed
  • Dependencies updated as needed
  • No lint/build errors or new warnings
  • All relevant tests are passing

High-level PR Summary

This PR enhances the egress control system to properly handle Ollama model pulls from different sources (Ollama registry vs Hugging Face). The backend now distinguishes between library pulls from registry.ollama.ai and hf.co/* fallback pulls from huggingface.co, ensuring network permissions are checked with the correct host. The frontend improves the Studio artifact creation workflow by adding a dedicated sources selection view, extracting a reusable Select component, and refining various UI text and styling details across settings and panels.

⏱️ Estimated Review Time: 30-90 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_local/backend/modules/egress/service.py
2 surfsense_local/backend/tests/unit/egress/test_service.py
3 surfsense_local/backend/modules/llm/router.py
4 surfsense_local/backend/modules/llm/recommendations/router.py
5 surfsense_local/backend/tests/integration/llm/test_egress.py
6 surfsense_local/backend/tests/integration/llm/test_routes.py
7 surfsense_local/frontend/src/features/egress/network-settings.tsx
8 surfsense_local/frontend/src/features/updates/update-settings.tsx
9 surfsense_local/frontend/src/components/ui/select.tsx
10 surfsense_local/frontend/src/features/studio/podcast-brief-form.tsx
11 surfsense_local/frontend/src/features/studio/studio-panel.tsx
12 surfsense_local/frontend/src/features/dashboard/dashboard-page.tsx
13 surfsense_local/frontend/src/features/settings/models-settings.tsx
14 surfsense_local/frontend/src/features/license/license-settings.tsx
15 surfsense_local/frontend/src/features/sources/sources-panel.tsx
16 surfsense_local/frontend/src/features/studio/artifact-list.tsx
17 surfsense_local/frontend/src/features/chat/chats-dialog.tsx
⚠️ Inconsistent Changes Detected
File Path Warning
surfsense_local/frontend/src/features/chat/chats-dialog.tsx Removes a from prop from ScrollShadow component, unrelated to egress/catalog or Studio workflow improvements
surfsense_local/frontend/src/features/sources/sources-panel.tsx Minor text size change (xs to sm) unrelated to the main egress or Studio source selection features
surfsense_local/frontend/src/features/studio/artifact-list.tsx Minor text size change (xs to sm) unrelated to the main egress or Studio source selection features

Need help? Join our Discord

AnishSarkar22 and others added 8 commits September 18, 2026 03:10
Move Composer's local selected-documents Set into the workspace sources
hook, passed down as selectedDocumentIds/onSelectionChange/onToggleAll,
so selection state can be shared with the rest of the dashboard.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The Composer dialog listed every ready document inline, pushing the
prompt field and Generate button down as sources grew. Replace it with
a compact "N sources" trigger that opens a dedicated sub-view (back
button, select-all, full checklist), with a soft opacity/blur crossfade
between the two and the Generate button pinned to the bottom of the
main view.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…al pull

The Download button in the model catalog hits POST /llm/install, which
never called egress.require() — only the unused /providers/{provider}/pull
route did. Chat models installed through the catalog UI left silently,
with no consent popup and no destination logged. Also derive the actual
host from the resolved pull target, since Ollama's hf.co/<repo> fallback
installs go straight to huggingface.co, not registry.ollama.ai.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…n clearly

The main/sources views shared one CSS grid cell so the row's height
included both children's content size — a long source list could grow
past its intended bound and spill out of the dialog instead of
scrolling. Overlay sources with position:absolute instead: main alone
(in normal flow) sets the dialog's height per format, and sources fills
that box exactly via inset-0, so its list scrolls within whatever
height that format's dialog has, however long the list gets.

Also renames the Updates settings heading to "App updates", matching
how it's already referred to in its own description and in
Settings > Network.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…move-speaker destructive

"Check now" now asks for App updates consent via the same egress prompt
the sidebar's automatic check already uses, instead of being disabled
until the automatic-updates switch is turned on elsewhere in the
dialog. Also gives the remove-speaker button in the podcast brief form
a destructive variant so a removal reads as such.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…t, bump list header text size

Select now lives in components/ui so other forms can reuse the OS-native
picker instead of a Radix/Base UI popup; Sources and Artifacts headers
move from text-xs to text-sm to match the rest of the panel.
The list's top/bottom fade blended toward --background, but the dialog
itself renders on --popover; the mismatch showed as a visible seam
around the first row.
Biome's noLabelWithoutControl couldn't verify the label wrapping
Radix's button-based Checkbox, so use useId + Label htmlFor/id
instead of wrapping.

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

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown

@AnishSarkar22 is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 50126d56-9ea6-431d-9195-48ea616f38d0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@AnishSarkar22 AnishSarkar22 changed the title Feat/local model catalog feat(local): gate egress-sensitive actions and refactor studio source selection Sep 17, 2026
@AnishSarkar22
AnishSarkar22 merged commit 141464d into MODSetter:dev Sep 17, 2026
4 of 8 checks passed
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