diff --git a/mast-react-vite/src/App.tsx b/mast-react-vite/src/App.tsx index 66e60be..18591cd 100644 --- a/mast-react-vite/src/App.tsx +++ b/mast-react-vite/src/App.tsx @@ -85,6 +85,14 @@ function App({ ctx }) { const todos = useQuery(ctx, "SELECT * FROM todos where completed = 0").data; const [newText, setNewText] = useState(""); const [rowSelection, setRowSelection] = useState({}); + // TODO: + // We need to seperate selection state + // From filter state + // Since we don't want selection to impact filter when we're filtering + // We want add to our selection state while we filter + // But selection state should apply to modify and done + // (but probably not add?) + const [selectionContext, setSelectionContext] = useState({}); const [currentAction, setCurrentAction] = useState("add"); const handleActionChange = (action: string) => { diff --git a/mast-react-vite/src/lib/command_parser.js b/mast-react-vite/src/lib/command_parser.js index bb19189..df611ca 100644 --- a/mast-react-vite/src/lib/command_parser.js +++ b/mast-react-vite/src/lib/command_parser.js @@ -1,4 +1,4 @@ -// @generated by Peggy 4.1.1. +// @generated by Peggy 4.2.0. // // https://peggyjs.org/ @@ -533,22 +533,22 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4; s0 = peg$currPos; - s1 = peg$parseFilters(); + if (input.substr(peg$currPos, 4) === peg$c1) { + s1 = peg$c1; + peg$currPos += 4; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e1); } + } if (s1 !== peg$FAILED) { s2 = peg$parse_(); if (s2 !== peg$FAILED) { - if (input.substr(peg$currPos, 4) === peg$c1) { - s3 = peg$c1; - peg$currPos += 4; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e1); } - } + s3 = peg$parseFilters(); if (s3 !== peg$FAILED) { s4 = peg$parseEOF(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f1(s1); + s0 = peg$f1(s3); } else { peg$currPos = s0; s0 = peg$FAILED; diff --git a/parser/command_js.peg b/parser/command_js.peg index 614a2b4..d3403fa 100644 --- a/parser/command_js.peg +++ b/parser/command_js.peg @@ -59,7 +59,7 @@ AddCommand = "add" _ parts:(Part / _)+ EOF { } // DONE COMMAND -DoneCommand = filters:Filters _ "done" EOF { +DoneCommand = "done" _ filters:Filters EOF { return makeCommand('done', filters, null); } diff --git a/parser/command_parser.js b/parser/command_parser.js index bb19189..df611ca 100644 --- a/parser/command_parser.js +++ b/parser/command_parser.js @@ -1,4 +1,4 @@ -// @generated by Peggy 4.1.1. +// @generated by Peggy 4.2.0. // // https://peggyjs.org/ @@ -533,22 +533,22 @@ function peg$parse(input, options) { var s0, s1, s2, s3, s4; s0 = peg$currPos; - s1 = peg$parseFilters(); + if (input.substr(peg$currPos, 4) === peg$c1) { + s1 = peg$c1; + peg$currPos += 4; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e1); } + } if (s1 !== peg$FAILED) { s2 = peg$parse_(); if (s2 !== peg$FAILED) { - if (input.substr(peg$currPos, 4) === peg$c1) { - s3 = peg$c1; - peg$currPos += 4; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e1); } - } + s3 = peg$parseFilters(); if (s3 !== peg$FAILED) { s4 = peg$parseEOF(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f1(s1); + s0 = peg$f1(s3); } else { peg$currPos = s0; s0 = peg$FAILED;