Open jewel-andraia opened 6 years ago
The filtering stage would be relative straight forward. I'm thinking:
In userHightlight.js
, add a storage containing values like these:
{
[username]: {
hightlightColor: 'red',
conditions: { type: 'group', op: 'any', of: [
/* list of browseContext conditions */
{ type: 'subreddit', patt: 'foo' },
{ type: 'subreddit', patt: 'bar' },
] }
}
}
and in module.beforeLoad
generate CSS:
for (const ([username, { highlightColor }] of Object.entries(highlightStorage.get()) {
if (await Case.fromConditions(conditions).evaluate())
highlightUser(username, highlightColor)
conditions
can be set by a builder
interface like is done in filteReddit/LineFilter.js
, i.e. caseBuilder.drawBuilderBlock(startConditions, browseCases)
A potential overblown design for @aslakhol's https://github.com/honestbleeps/Reddit-Enhancement-Suite/issues/4722#issuecomment-429592085
Summary
Use the "post/comment filters" engine to determine if a user tag should be displayed. Add/alter UI entry points to set filters for user tags.
Use cases
Implementation details