from Kozaneba Development Diary 2021-09-01 2021-09-02Kozaneba Development Diary
release notes
release notes
I've added the ability to delete a place to the developer menu for now.
release notes
release notes
custom.url in kozane is neither empty string nor undefined:.visit is added to the menuI put minSize on the group, but there will be cases where it's "too picky and hard to select".
release notes
custom.url is created when pasting a URLCan "make part of a Ba into another Ba."
I'm going to use it for something else.
Exit from selection mode if selection is empty
Crash after copy-pasting an unnamed group and then ungrouping the group inside
release notes
I'll need a local backup.
release notes
Hmmm... ts
const p = get_group(getGlobal(), parent);
if (p.items.length === 0 && p.text === "") {
updateGlobal((g) => {
remove_item(g, parent);
});
} else {
normalize_group_position(parent);
}
There are three different component constructions...
Hmmm, shall I make draft the second argument to receive and "if omitted, make it yourself"? ts
export const normalize_group_position = (gid: ItemId) => {
updateGlobal((g) => {
...
});
};
Here.
do (auxiliary used in place of "-masu" after a -masu stem) ts
export const normalize_group_position = (gid: ItemId, draft?: State) => {
const body = (g: State) => {
...
};
if (draft === undefined) {
updateGlobal(body);
} else {
body(draft);
}
};
furthermore ts
export const normalize_group_position = (gid: ItemId, draft?: State) => {
optional_draft(draft, (g) => {
...
});
};
const optional_draft = (
draft: State | undefined,
f: (g: State) => void
): void => {
if (draft === undefined) {
updateGlobal(f);
} else {
f(draft);
}
};
Now the optional_draft part is common and you only need to rewrite the first two lines of the utility that does not accept existing drafts
https://twitter.com/nishio/status/1433356592620081155?s=20
Oh, I see.
next: Kozaneba Development Diary 2021-09-03
This page is auto-translated from /nishio/Kozaneba開発日記2021-09-02 using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I'm very happy to spread my thought to non-Japanese readers.