Skip to content

default state of data sources side panel is open#165

Open
DinaLaptii wants to merge 5 commits intoNVIDIA-AI-Blueprints:developfrom
DinaLaptii:fix/state-side-panel-data-sources
Open

default state of data sources side panel is open#165
DinaLaptii wants to merge 5 commits intoNVIDIA-AI-Blueprints:developfrom
DinaLaptii:fix/state-side-panel-data-sources

Conversation

@DinaLaptii
Copy link
Copy Markdown
Contributor

I need to add the feature toggle logic for the new UI from another pr

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 31, 2026

Greptile Summary

This PR changes the default state of the data sources side panel from closed (null) to open ('data-sources'), and updates handleNewSession to keep the panel open (instead of closing it) when starting a new session. All five changed files — store, component, both specs, and types — are mutually consistent with the new behavior.

Confidence Score: 5/5

Safe to merge — changes are minimal, internally consistent, and all tests updated correctly.

All five files agree on the new default behavior. The store's initial state, its action implementations, the type declarations, and both spec files are fully consistent. No logic errors, type mismatches, or missing updates were found. The previously flagged disableNonWebSources/disableEciSources mismatch does not exist in the current code.

No files require special attention.

Important Files Changed

Filename Overview
frontends/ui/src/features/layout/store.ts Initial rightPanel state changed from null to 'data-sources'; added ECI opt-in comment
frontends/ui/src/features/layout/components/MainLayout.tsx handleNewSession now calls openRightPanel('data-sources') instead of closeRightPanel
frontends/ui/src/features/layout/store.spec.ts Tests updated to match new default rightPanel; added null reset before close-when-closed test
frontends/ui/src/features/layout/components/MainLayout.spec.tsx Mock switched from closeRightPanel to openRightPanel; assertion updated; email updated to nvidia.com
frontends/ui/src/features/layout/types.ts Minor JSDoc comment update for disableNonWebSources; no type or interface changes

Sequence Diagram

sequenceDiagram
    participant User
    participant MainLayout
    participant useLayoutStore
    Note over useLayoutStore: Initial state: rightPanel = 'data-sources'
    User->>MainLayout: Click "New Session"
    MainLayout->>useLayoutStore: startNewSessionDraft()
    MainLayout->>useLayoutStore: clearSessionUrl()
    MainLayout->>useLayoutStore: openRightPanel('data-sources')
    useLayoutStore-->>MainLayout: rightPanel = 'data-sources'
    MainLayout-->>User: Data Sources panel stays visible
Loading

Reviews (4): Last reviewed commit: "revert naming" | Re-trigger Greptile

Comment on lines 123 to 132
disableEciSources: () =>
set(
(state) => ({
enabledDataSourceIds: state.enabledDataSourceIds.filter(
(id) => id === WEB_SEARCH_SOURCE_ID
),
}),
false,
'disableNonWebSources'
'disableEciSources'
),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 types.ts not updated to match renamed action

disableNonWebSources was renamed to disableEciSources in store.ts, but types.ts line 79 still declares disableNonWebSources: () => void in the LayoutActions interface. Because the store is typed as create<LayoutStore>() where LayoutStore = LayoutState & LayoutActions, TypeScript will report a compile error: the store object is missing the required disableNonWebSources method.

Update types.ts to reflect the rename:

// types.ts, line 78-79
/** Disable all ECI (non-web) sources (keep only web_search enabled) */
disableEciSources: () => void

@exactlyallan
Copy link
Copy Markdown
Collaborator

TBH I would wait on this PR since we are working on a more holistic design to fix this issue.

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