codeant-ai-for-open-source[bot] commented on code in PR #37141:
URL: https://github.com/apache/superset/pull/37141#discussion_r3651466868
##########
superset-frontend/src/dashboard/components/DashboardBuilder/state.ts:
##########
@@ -121,5 +121,6 @@ export const useNativeFilters = () => {
dashboardFiltersOpen,
toggleDashboardFiltersOpen,
nativeFiltersEnabled,
+ hasFilters: filterValues.length > 0,
Review Comment:
**Suggestion:** The mobile filter affordance is derived from
`filterValues.length`, which represents populated filter values rather than
whether the dashboard has any configured native filters. A dashboard with
filters whose values are empty or unset will report `hasFilters` as false, so
the filter bar/drawer can be hidden and users have no way to open those
filters. Derive this from the configured native-filter definitions instead of
the current value state. [logic error]
<details>
<summary><b>Severity Level:</b> Critical 🚨</summary>
```mdx
- ❌ Mobile users cannot open configured filters with empty initial values.
```
</details>
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Enable `MOBILE_CONSUMPTION_MODE` and open a dashboard at a viewport below
the Ant
Design `md` breakpoint, which activates the mobile dashboard experience
described in the
PR.
2. Configure the dashboard with a native filter whose initial value is empty
or unset;
this leaves the hook's `filterValues` collection empty while the dashboard
still has a
configured filter definition.
3. During `useNativeFilters` execution in
`superset-frontend/src/dashboard/components/DashboardBuilder/state.ts`, the
returned
`hasFilters` value is computed at line 124 as `filterValues.length > 0`,
producing
`false`.
4. The mobile filter affordance consumes `hasFilters` and treats the
dashboard as having
no filters, so the filter bar or drawer is not offered and the user cannot
open the
configured native filter to select a value.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=373d3069f789472d86aa6410822a6d02&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=373d3069f789472d86aa6410822a6d02&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:**
superset-frontend/src/dashboard/components/DashboardBuilder/state.ts
**Line:** 124:124
**Comment:**
*Logic Error: The mobile filter affordance is derived from
`filterValues.length`, which represents populated filter values rather than
whether the dashboard has any configured native filters. A dashboard with
filters whose values are empty or unset will report `hasFilters` as false, so
the filter bar/drawer can be hidden and users have no way to open those
filters. Derive this from the configured native-filter definitions instead of
the current value state.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F37141&comment_hash=d2a841070e5589aa89f9441e3308adeefbcb7907ce69b374f21bca1a20514c79&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F37141&comment_hash=d2a841070e5589aa89f9441e3308adeefbcb7907ce69b374f21bca1a20514c79&reaction=dislike'>👎</a>
##########
docker/pythonpath_dev/superset_config.py:
##########
@@ -110,6 +110,7 @@ class CeleryConfig:
"ALERT_REPORTS": True,
"DATASET_FOLDERS": True,
"ENABLE_EXTENSIONS": True,
+ "MOBILE_CONSUMPTION_MODE": True,
Review Comment:
**Suggestion:** The development configuration explicitly enables
`MOBILE_CONSUMPTION_MODE`, so every Docker development instance uses the
experimental mobile route restrictions by default, even though the feature is
documented as default-off and operators are expected to opt in. This can
unexpectedly hide authoring and non-dashboard routes for developers; remove
this override or make it opt-in through the environment. [logic error]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ❌ Development users unexpectedly receive mobile route restrictions.
- ⚠️ Authoring routes disappear on narrow development viewports.
- ⚠️ Local UI testing no longer matches default-off behavior.
```
</details>
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Start the Superset development environment using the configuration loaded
from
`docker/pythonpath_dev/superset_config.py`; line 113 sets
`FEATURE_FLAGS["MOBILE_CONSUMPTION_MODE"]` to `True` for every such instance.
2. Open the development Superset application in a browser and reduce the
viewport below
the documented 768px `antd` `md` breakpoint.
3. The PR's `useIsMobile()` condition evaluates as enabled because the
feature flag is
true and the viewport is below `md`.
4. The mobile route guard and consumption-mode UI described in the PR then
hide authoring
and unsupported routes, even though no per-instance opt-in was performed;
this reproduces
the configuration mismatch. The override may be intentional for local
feature development,
but it is not default-off for users of this development configuration.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=bdef502efe8f443dac4303d063f924ff&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=bdef502efe8f443dac4303d063f924ff&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** docker/pythonpath_dev/superset_config.py
**Line:** 113:113
**Comment:**
*Logic Error: The development configuration explicitly enables
`MOBILE_CONSUMPTION_MODE`, so every Docker development instance uses the
experimental mobile route restrictions by default, even though the feature is
documented as default-off and operators are expected to opt in. This can
unexpectedly hide authoring and non-dashboard routes for developers; remove
this override or make it opt-in through the environment.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F37141&comment_hash=4ac0b1090c191d93d016446314d7f78619cd3a43abbaee0dbb412bf45f71afae&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F37141&comment_hash=4ac0b1090c191d93d016446314d7f78619cd3a43abbaee0dbb412bf45f71afae&reaction=dislike'>👎</a>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]