Smart Page List #394
Replies: 2 comments
-
|
owner @clszzyh |
Beta Was this translation helpful? Give feedback.
-
Summary
Core LifestyleParse and InterpretFilter Strategies is registered dynamically. const smartPageListInterpreter = new FormulaInterpreter({
version: "v1",
lexer: [
WHITESPACE_TOKEN,
AND_TOKEN,
OR_TOKEN,
LParen, RParen // To support the parenthesis.
],
parser: [
combineExpression,
parenthesisExpression // To support the parenthesis.
],
interpreter: [
combineInterpret
],
filterStrategies: [
parentPageFilter,
...
],
...
})Usage: const filterPredicate = smartPageListInterpreter.parse(' ParentPageIs("current page name") OR ParentPageIs("other page name") ')
typeof filterPredicate
interface ParseResult {
success: boolean
codeFragments: CodeFragment[]
}
interface SuccessParseResult extends ParseResult {
success: true
predicate: (aPage: PageType) => [true, MatchReasonIfNeed] | [false]
}
interface ErrorParseResult extends ParseResult {
success: false
errorMessage: [ErrorMessage, ...ErrorMessage[]]
}Apply filterconst pageList = currentPages.filter(p => filterPredicate.predicate(p))Filter is only on the frontend since fat client. Process result
Filter Strategy1.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
Articulate the problem that this piece of work addresses
We need a smart page list block inspired by macOS' smart folders to improve the experience of organising pages.
Why is this the right time to address this problem?
Time Budget
2 weeks
Solution
/smartpagelist.Out of Bounds
parent page is xfilter needs to be supportedRabbitholes
Beta Was this translation helpful? Give feedback.
All reactions