feat: done command parsing
starting to come together I realized I'm going to have to seperate selection and filter state And do actions based on that, some how show that different context depending on which action is selected
This commit is contained in:
parent
1c27dd249e
commit
b268065d13
|
@ -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) => {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue