-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Allow to star and unstar stored segment #23771
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
base: 5.x-dev
Are you sure you want to change the base?
Conversation
24a8707 to
cb064c5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ The new tests changed the visible focused element on this screenshot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ The starred segment comes at the top of the list
| self.target.find('[title]').each(function () { | ||
| addTooltip(this, this.getAttribute('title')); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ Fix tooltip for all actions in the SegmentList
| display: flex; | ||
| flex-direction: column; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ Use flexbox to be able to reorder starred segment easily.
| .segmentationContainer .submenu ul li[data-idsegment=""] { | ||
| order: 0; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ First line is always "All visitors"
d004753 to
5c02c19
Compare
michalkleiner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some inline comments.
With the addition of who marked the segment as favourite, I wonder whether there was a discussion that each use might want to save different segments as favourite, no having it global.
Yes, that was discussed and decided by Matt. |
chippison
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I found a small issue with the UI
This seems to happen only in Chrome and can confirm this looks correct in both Safari and Firefox
The SegmentEditor seems to show a vertical scrollbar when I add a new Segment
It also just seems to grow as I add new Segments
Screenshots above are from my tests in Chrome Browser
|
|
||
| $(self.target).find(".segmentList li").each(function () { | ||
| curTitle = $(this).prop('title'); | ||
| curTitle = $(this).find('.segname').prop('title'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ Fix search, since I moved the title from the li to segname (li child) so I can have another title on star icon.
| clearTimeout(self.filterTimer); | ||
| self.filterTimer = false; | ||
| if (search.length >= 2) { | ||
| clearTimeout(self.filterTimer); | ||
| self.filterAllowed = true; | ||
| self.filterTimer = setTimeout(function () { | ||
| filterSegmentList(search); | ||
| }, 500); | ||
| } | ||
| else { | ||
| self.filterTimer = false; | ||
| clearFilterSegmentList(); | ||
| } else { | ||
| self.filterTimer = setTimeout(clearFilterSegmentList, 500); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ I add a clearTimeout even if there is less than 2 characters to avoid a bug when we are typing too fast.
For example:
I also added a timer when there is 0 or 1 character since it does a lot of DOM modifications.
| span.compareSegment, | ||
| .starSegment { | ||
| flex: none; | ||
| display: flex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Done! |
| const className = 'compareSegment allVisitsCompareSegment ' + (self.segmentAccess === 'write' ? 'allVisitsCompareSegment--write' : ''); | ||
| const title = _pk_translate('SegmentEditor_CompareThisSegment'); | ||
| listHtml += '<span class="' + className + '" title="' + title + '"></span>'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| .segmentationContainer hr { | ||
| margin: 10px 0; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8065736 to
38cae01
Compare
15fa35e to
a303458
Compare
| function updateStarredSegment($segment, segment, isError = false) { | ||
| updateStarSegmentTooltip($segment, segment); | ||
| $segment.toggleClass('segmentStarred', segment.starred); | ||
| $segment.one('animationend', function avoidAnimationRepetition() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be $segment.on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is intended.
$segment.one() is the same than $segment.on() but it only triggered one time.
It is the same than element.addEventListener(callback, { once: true });
|
Functional Testing is done with different users. Can see the correct user shown that 'starred' the segment. |






Description
New “Star” Feature: each segment can be "starred" by clicking on a star icon.
Starred segments are highlighted at the top of the list.
What happen when a segment star is clicked :
Screenshots
before / after
tooltips
Animation
Checklist
Review