Skip to content

fix: Info panel scroll-to-top setting not persistent across dashboard sessions #2938

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/dashboard/Data/Browser/DataBrowser.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import AggregationPanel from '../../../components/AggregationPanel/AggregationPa

const BROWSER_SHOW_ROW_NUMBER = 'browserShowRowNumber';
const AGGREGATION_PANEL_VISIBLE = 'aggregationPanelVisible';
const BROWSER_SCROLL_TO_TOP = 'browserScrollToTop';

function formatValueForCopy(value, type) {
if (value === undefined) {
Expand Down Expand Up @@ -83,6 +84,8 @@ export default class DataBrowser extends React.Component {
window.localStorage?.getItem(BROWSER_SHOW_ROW_NUMBER) === 'true';
const storedPanelVisible =
window.localStorage?.getItem(AGGREGATION_PANEL_VISIBLE) === 'true';
const storedScrollToTop =
window.localStorage?.getItem(BROWSER_SCROLL_TO_TOP) !== 'false';
const hasAggregation =
props.classwiseCloudFunctions?.[
`${props.app.applicationId}${props.appName}`
Expand All @@ -107,7 +110,7 @@ export default class DataBrowser extends React.Component {
showAggregatedData: true,
frozenColumnIndex: -1,
showRowNumber: storedRowNumber,
scrollToTop: true,
scrollToTop: storedScrollToTop,
prefetchCache: {},
selectionHistory: [],
};
Expand Down Expand Up @@ -669,7 +672,11 @@ export default class DataBrowser extends React.Component {
}

toggleScrollToTop() {
this.setState(prevState => ({ scrollToTop: !prevState.scrollToTop }));
this.setState(prevState => {
const newScrollToTop = !prevState.scrollToTop;
window.localStorage?.setItem(BROWSER_SCROLL_TO_TOP, newScrollToTop);
return { scrollToTop: newScrollToTop };
});
}

getPrefetchSettings() {
Expand Down
Loading