Skip to content

Add a Segment Management Page#23885

Merged
caddoo merged 32 commits into5.x-devfrom
ux-326-2
Mar 11, 2026
Merged

Add a Segment Management Page#23885
caddoo merged 32 commits into5.x-devfrom
ux-326-2

Conversation

@tzi
Copy link
Copy Markdown
Contributor

@tzi tzi commented Dec 9, 2025

Description

fixes #20659

We propose the introduction of a new page in Matomo, titled "Segments."
This page will serve as a combined reporting and management tool to make it easy to view (and edit) all segments for a website, and also provide a clean dashboard to view All segment data at once.

image

Features

  • The search input allow us to filter the segments
  • We can star and unstar segments according to the current user right.
    If needed, a tooltip explain why we cannot do an action. If it is a global segment, the tooltip precise that starring/unstarring it will affect all websites.
  • We can see Visits / Actions / Evolution Visits for each segment according to the selected period.
  • We can go back to the dashboard with a specific segment selected
  • We can edit a segment, according to the current user right.
    If we choose to edit a segment, it opens the segmentEditorPanel
  • We can delete a segment, according to the current user right.
    If we choose to delete a segment, it opens the segmentEditorPanel and trigger a new modal that ask confirmation before deleting it.
  • We can create a new segment according to the user right AND segment configuration.

Data Synchronization with the Panel

Starring/Unstarring will reorder segments without reload. The Page and the Panel are always synchronized.

Editing from Page Editing from Panel
ezgif-fromPage ezgif-fromPanel

Menus

 in the Dashboard menu in the Administration Menu
Visitors > Segments Websites > Segments
Screenshot 2026-01-12 at 17 31 16 Screenshot 2026-01-12 at 17 31 28

We added an outlink icon to the administration because this link goes back to the Dashboard. We choose this behaviour because the website / date / segment selector are needed and not available in the administration layout.

Plugins

This PR will have impact on plugins UI screenshots:

Checklist

  • [NA] I have understood, reviewed, and tested all AI outputs before use
  • [NA] All AI instructions respect security, IP, and privacy rules

Review

@tzi tzi added Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. c: Segments Segmentation and Segment editor related improvements and fixes. labels Dec 9, 2025
@tzi tzi force-pushed the ux-326-2 branch 9 times, most recently from 13932db to 597f770 Compare December 23, 2025 08:26
@tzi tzi force-pushed the ux-326-2 branch 2 times, most recently from adcf8af to 6fb66bd Compare December 30, 2025 14:02
@tzi tzi force-pushed the ux-326-2 branch 2 times, most recently from fc0cb9b to e353f4f Compare January 12, 2026 10:49
Comment thread plugins/CoreHome/stylesheets/dataTable/_dataTable.less
Comment thread plugins/CoreVue/types/index.d.ts
Comment thread core/Menu/MenuAdmin.php
Comment thread plugins/CoreHome/vue/src/Sparkline/Sparkline.less
Comment thread plugins/Goals/Menu.php
Comment thread plugins/SegmentEditor/javascripts/Segmentation.js Outdated
Comment thread plugins/SegmentEditor/javascripts/Segmentation.js
Comment thread plugins/SegmentEditor/javascripts/Segmentation.js Outdated
Comment thread plugins/SegmentEditor/lang/en.json
Comment thread plugins/SegmentEditor/stylesheets/segmentation.less
Comment thread plugins/SegmentEditor/templates/_segmentSelector.twig
Comment thread plugins/SegmentEditor/templates/manageSegments.twig
@tzi tzi removed the Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. label Jan 12, 2026
chippison
chippison previously approved these changes Mar 9, 2026
@caddoo
Copy link
Copy Markdown
Contributor

caddoo commented Mar 10, 2026

Did some basic testing

The re-ordering on starring is jarring, so much I thought it was a bug, but that's not up for discussion now.

Here is a test report of what I covered.

ID Area Role Steps (Manual) Expected Result
P0-01 Visitors menu entry Admin Open reporting UI, go to Visitors > Segments Segments management page loads without error PASS
P0-02 Admin measurables entry Admin Open admin UI, go to Administration > Measurables/Websites > Segments Same Segments page opens PASS
P0-03 Selector button link Admin Open segment selector dropdown, click MANAGE SEGMENTS Navigates to Segments page PASS
P0-04 Star in selector (immediate feedback) Admin In selector, star a non-starred segment Star icon becomes filled immediately; row visually starred PASS
P0-05 Unstar in selector Admin Unstar previously starred segment Icon unfilled; row no longer starred PASS
P0-06 Star persistence after reload Admin Star a segment, reload page, reopen selector/manage page Segment remains starred PASS
P0-07 Star from manage page reorder Admin On Segments page, click star on unstarred row Row becomes starred and moves to starred section/top ordering immediately PASS
P0-08 Unstar from manage page reorder Admin Unstar same row Row returns to unstarred ordering group PASS
P0-09 Selector → page sync Admin Star/unstar in selector, then open Segments page Matching row state is synced (star class/icon/order) PASS
P0-10 Page → selector sync Admin Star/unstar on Segments page, then open selector Matching selector item state is synced PASS
P0-11 View action applies segment Admin On Segments page click View icon for global segment Opens dashboard/reporting with that segment applied in top selector PASS
P0-12 View action encoded segment Admin Click View for complex encoded segment URL/hash keeps valid segment definition; selected segment title matches PASS
P0-13 Edit action from page Admin Click Edit icon on a site segment Segment editor opens in edit mode for correct segment PASS
P0-14 Delete cancel safety Admin Click Delete, choose No/Cancel Segment remains present PASS
P0-15 Delete confirm Admin Click Delete, choose Yes Segment removed from list and absent after reload PASS
P0-16 View-only permission gate View-only user Open Segments page, inspect star/edit/delete icons View available; star/edit/delete disabled with permission tooltip PASS
P0-17 Anonymous star restriction Anonymous Open selector and inspect star controls Star action unavailable/disabled; no unauthorized state change PASS
P0-18 Realtime KPI suppression Admin Compare one preprocessed vs one realtime segment row Preprocessed row gets numeric visits/actions; realtime row shows - KPI/evolution PASS
P0-19 XSS hover safety Admin Hover a segment name containing script-like text No alert/script execution; UI remains normal PASS
P1-01 Search filter threshold Admin On Segments page, type 1 char then 2+ chars in search No effective filter at 1 char; filtering starts at 2+ chars PASS
P1-02 Search no-results state Admin Search non-matching term Rows hidden and “no results” label shown PASS
P1-03 Search clear restore Admin Clear search input All rows reappear; no-results label hidden PASS
P1-04 Starred ordering stability Admin Star multiple segments with different names, reload Starred group remains above unstarred; order stays stable/consistent PASS
P1-05 Tooltip correctness (site/global) Admin Hover star/edit/delete on site and global segments Tooltips reflect correct action/context (site vs global, star/unstar text) PASS
P1-06 Tooltips under permissions View-only user Hover disabled star/edit/delete “Cannot …” tooltip variants shown correctly PASS

…24199)

* SegmentEditor.getSegmentData API moved to the API file and renamed parameter

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

Labels

c: Segments Segmentation and Segment editor related improvements and fixes. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.

Development

Successfully merging this pull request may close these issues.

New Segments Page: Combined Reporting and Management

6 participants