1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-11 00:20:54 +00:00
* Added: When searching in the FFZ Control Center, you can now use the tag `@modified` to filter by settings that have been changed in the current profile.
* Added: Add-ons now have Changelog buttons that navigate to a changelog showing only entries for that add-on.
* Changed: The Changelog pages now has nicer formatting for each commit, including add-on icons and clickable links to add-on sub-pages when viewing the Add-on Changelog.
* API Added: To prevent FrankerFaceZ from loading into a page, include `disable_frankerfacez` in the URL query parameters.
* Experiment Changed: Fix incorrect roll-out percentage for API-Based Link Lookups. This should be fully enabled.
* Experiment Changed: Lower the percentage of users in the MQTT-Based PubSub experiment.
This commit is contained in:
SirStendec 2023-11-06 20:47:19 -05:00
parent 5046088bf7
commit ba72969c51
17 changed files with 416 additions and 72 deletions

View file

@ -13,7 +13,7 @@
<li
v-for="item in displayed"
:key="item.full_key"
:class="[currentItem === item ? 'active' : '']"
:class="[(currentItem === item || item.hide_children && containsCurrent(item)) ? 'active' : '']"
:data-key="item.full_key"
role="presentation"
>
@ -26,7 +26,7 @@
>
<span
:class="[
item.items ? '' : 'ffz--invisible',
(item.items && ! item.hide_children) ? '' : 'ffz--invisible',
item.expanded ? 'ffz-i-down-dir' : 'ffz-i-right-dir'
]"
role="presentation"
@ -46,10 +46,11 @@
</span>
</div>
<menu-tree
v-if="item.items && item.expanded"
v-if="item.items && item.expanded && ! item.hide_children"
:root="item"
:current-item="currentItem"
:modal="item.items"
:context="context"
:filter="filter"
@change-item="i => $emit('change-item', i)"
@mark-seen="i => $emit('mark-seen', i)"
@ -97,7 +98,7 @@ function recursiveExpand(node, vue) {
export default {
props: ['root', 'modal', 'currentItem', 'filter'],
props: ['root', 'modal', 'currentItem', 'filter', 'context'],
computed: {
tabIndex() {
@ -110,18 +111,36 @@ export default {
},
methods: {
shouldShow(item) {
if ( ! this.filter || ! this.filter.length || this.containsCurrent(item) )
shouldShow(item, is_walking = false) {
if ( ! this.filter || this.containsCurrent(item) )
return true;
if ( item.search_terms && item.search_terms.includes(this.filter) )
return true;
if ( this.filter.flags ) {
if ( this.filter.flags.has('modified') ) {
// We need to tree walk for this one.
if ( ! is_walking ) {
for(const key of ['tabs', 'contents', 'items'])
if ( item[key] )
for(const thing of item[key])
if ( this.shouldShow(thing) )
return true;
}
return false;
if ( ! item.setting || ! this.context.currentProfile.has(item.setting) )
return false;
}
}
if ( this.filter.query ) {
if ( ! item.search_terms || ! item.search_terms.includes(this.filter.query) )
return false;
}
return true;
},
countMatches(item, seen) {
if ( ! this.filter || ! this.filter.length || ! item )
if ( ! this.filter || ! item )
return 0;
if ( seen && seen.has(item) )
@ -139,7 +158,7 @@ export default {
for(const thing of item[key])
count += this.countMatches(thing, seen);
if ( item.setting && item.search_terms && item.search_terms.includes(this.filter) )
if ( item.setting && this.shouldShow(item, true) )
count++;
return count;