Skip to content

[19.0][IMP] mis_builder: Improve drilldown navigation with cache report support - #827

Open
petrus-v wants to merge 4 commits into
OCA:19.0from
petrus-v:19.0-imp-cache-report-data
Open

petrus-v wants to merge 4 commits into
OCA:19.0from
petrus-v:19.0-imp-cache-report-data

Conversation

@petrus-v

@petrus-v petrus-v commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

When navigating away from a MIS report via drilldown links and returning using the breadcrumb, active search filters and pivot date were lost.

  • First commit preserves the report widget state across view navigation (only using breadcrumb)
  • second commit Allow caching computed report data in browser memory during drilldown
    navigation to prevent recomputing the report when returning via breadcrumbs (this feature is opt out by default for consistency with current version).
  • third commit fix navigation while using browser navigation back button (before this commit we get the config view instead of the preview form)
Capture.video.du.2026-08-26.17-26-40.mp4
  • commit 8882b31 is to fix an issue when search bar widget is not displayed (internal issue ref #98869)

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @sbidoul,
some modules you are maintaining are being modified, check this out!

@petrus-v

Copy link
Copy Markdown
Contributor Author

I've force/push a refactor to expose exportState and _restoreState that a future module could improve the search view (such as the pivot date) and save/restore its state easily !

@AnizR AnizR left a comment

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.

Code lgtm
Tested on runboat

@sbidoul

sbidoul commented Aug 21, 2026

Copy link
Copy Markdown
Member

Not looked at the code yet but a question: what is the scope of the cache, how is memory managed, is there a risk of memory leak?

@petrus-v

Copy link
Copy Markdown
Contributor Author

Not looked at the code yet but a question: what is the scope of the cache, how is memory managed, is there a risk of memory leak?

Cache is scoped to the Form Controller so as soon user will click on a new menu, the allocated RAM should be available to the GC.

When navigating away from a MIS report via drilldown links and returning
using the breadcrumb, active search filters and pivot date were lost.

This commit preserves the report widget state across view navigation:
- Register `useSetupAction` in `MisReportWidget` to export search model
  state and pivot date when leaving the controller.
- Forward `props.state` to `env.config.state` in `FormController` so that
  restored controller state is accessible during component `willStart`.
- Hydrate `searchModel` and `pivot_date` upon view restoration.
- Add JS tour `mis_report_drilldown_tour` and HttpCase test
  `TestMisReportWidgetTour` to validate filter preservation end-to-end.

Assisted-by: Gemini 3.6 Flash
Allow caching computed report data in browser memory during drilldown
navigation to prevent recomputing the report when returning via breadcrumbs.

- Add `widget_cache_report_on_drill_down` boolean field (default False)
  to `mis.report.instance` and its form view.
- Export `cachedReportData` in `MisReportWidget` local state when active.
- Reuse cached matrix data upon breadcrumb restoration, skipping the `compute` RPC call.
- Invalidate cache automatically on filter or pivot date updates.
- Add `test_mis_report_drilldown_cache_tour` test.
- Add usage documentation

Assisted-by: Gemini 3.6 Flash
@petrus-v
petrus-v force-pushed the 19.0-imp-cache-report-data branch from 1b1283c to e527746 Compare August 22, 2026 14:39
- Add mis_report_instance_preview_action to fix back button
  navigation when opening preview from list view.
- Use useSetupAction({ getGlobalState }) and FormController patch to
  preserve search filters, pivot date, and cached report data
  upon browser back (popstate) navigation.

Assisted-by: Gemini 3.6 Flash
@petrus-v petrus-v changed the title [19.0][IMP] mis_builder: cache report data on drilldown [19.0][IMP] mis_builder: Improve drilldown navigation with cache report support Aug 26, 2026
@petrus-v

Copy link
Copy Markdown
Contributor Author

I've close #826 because this PR was based on it. Also I've add the third commit that fix coming back from drill-down using browser navigation buttons

@petrus-v
petrus-v force-pushed the 19.0-imp-cache-report-data branch from 8882b31 to 07d1ba5 Compare September 2, 2026 14:36
@vdewulf

vdewulf commented Sep 7, 2026

Copy link
Copy Markdown

hello !
@petrus-v I was wondering if the improvement you propose would also solve this case:

  • I view the report which is very long. I need to scroll down to check a specific line.
  • I click on the value for the specific line. This opens the drilldown view.
  • I want to go back to the report, I click on the breadcrumb
  • Result: the report is displayed from the top. I need to scroll again to continue the control on the subsequent lines

When we do control on a lot of clients databases, this takes a lot of time and makes us scroll a lot. Any idea if this fix would help or if this is something different?
Thanks!

@petrus-v

petrus-v commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

hello ! @petrus-v I was wondering if the improvement you propose would also solve this case:

* I view the report which is very long. I need to scroll down to check a specific line.

* I click on the value for the specific line. This opens the drilldown view.

* I want to go back to the report, I click on the breadcrumb

* Result: the report is displayed from the top. I need to scroll again to continue the control on the subsequent lines

When we do control on a lot of clients databases, this takes a lot of time and makes us scroll a lot. Any idea if this fix would help or if this is something different? Thanks!

Hi @vdewulf :) !

Thanks for reporting this, I've test on a customer instance where this PR is installed, unfortunately I've reproduce the behavior so at the moment this PR doesn't seems to scroll down to the clicked cell while coming back from a drilldown !

(on that instance we have project module that play with sticky column and other css stuff that I'm not 100% sure if that could be different without those project modules).

Anyway I think this PR is large enough for review and if getting stable, I would suggested to report the issue if not already present or do it in a new PR on top of this one !

Definitively a good idea, I already imagine a css animation to highlight the clicked cell few seconds 🌟

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants