MemberJunction / MemberJunction/MJ

Data Explorer: Configure View "Save" on the default (unsaved) view silently drops Smart/Traditional filters

Open
#4,220 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TSQL
Stars
29
Forks
6
Avg merge
2d 1h
Merged PRs (30d)
323

Description

## Summary

In the Data Explorer, open **Configure View → Filters** while the entity's **default (unsaved) view** is selected, set a Smart Filter prompt or build a Traditional Filter, and click **Save**. The panel closes and nothing happens: no view is created, no error is shown, the grid stays unfiltered.

## Where

`packages/Angular/Generic/entity-viewer/src/lib/view-config-panel` and `view-workspace`.

The config panel footer renders three different primary buttons depending on state:

| State | Button | Handler | Persists filters? |
|---|---|---|---|
| A saved view is selected (`ViewEntity && CanEdit`) | Save | `OnSave()` → `onSaveView()` → `persistExistingView()` | Yes |
| Arrived via quick-save "Customize columns, filters & sorting..." (`!ViewEntity && DefaultSaveAsNew`) | Create View | `OnSaveAsNew()` → `persistNewView()` | Yes |
| Default / dynamic view (`!ViewEntity && !DefaultSaveAsNew`) | **Save** | `OnSaveDefaults()` → `onSaveDefaultViewSettings()` | **No** |

`onSaveDefaultViewSettings()` writes only `columnSettings` / `sortSettings` / `aggregates` to the `default-view-setting/` user setting. It ignores `SmartFilterEnabled`, `SmartFilterPrompt` and `FilterState` from the `ViewSaveEvent` entirely. Meanwhile the Filters tab is fully editable in that state and its alert says "The AI will interpret your description and create the appropriate filter when you save the view."

Data Explorer lands users on the default view, so this is the first thing a new user hits.

## Workaround

View selector → **Save as new view** → **Customize columns, filters & sorting...** → configure filters → **Create View**. Or select an existing saved view first.

## Suggested fix

When the default view has a filter configured (smart prompt non-empty in smart mode, or `FilterState.filters.length > 0`), "Save" should create a named view instead of writing preferences: reuse the quick-save name prompt, merge the panel's columns/sort/filter/smart state into the `ViewSaveEvent` (today `executeQuickSave()` hard-codes `SmartFilterEnabled: false`), then `persistNewView()` and select the new view. Alternatively, disable the Filters tab on the default view with a hint pointing at "Save as new view".

## Context

Found while fixing #4203 (Smart Filter WhereClause never generated on create). That PR fixes the entity-layer bug; this UI path is intentionally excluded from it.

Contributor guide

Open the contributing guide

Research direction

Start in packages/Angular/Generic/entity-viewer/src/lib/view-config-panel and view-workspace, tracing OnSaveDefaults(), onSaveDefaultViewSettings(), executeQuickSave(), and persistNewView(). Verify the default view's Save path preserves configured filters and creates/selects a named view, while existing saved-view and quick-save paths continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.