Skip to content

Commit 70b883b

Browse files
committed
Doc updates, Multirow filtering, strlcpy, inline
1 parent 77646f0 commit 70b883b

File tree

7 files changed

+12746
-12734
lines changed

7 files changed

+12746
-12734
lines changed

docs/develop/development.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ npm run dev
3737

3838
There are 3 levels to add functionality:
3939

40-
* **Standard ESP32-Sveltekit code**, e.g. Connections, Wifi and System. MoonBase files is also made using standard sveltekit as example but contains a few components used in MoonLight modules. Might be rewriteen as MoonLight Module in the future.
41-
* lib folder for Sveltekit vack-end
40+
* **Standard ESP32-Sveltekit code**, e.g. Connections, Wifi and System. MoonBase files are also made using standard SvelteKit as examples but contain a few components used in MoonLight modules. Might be rewritten as a MoonLight Module in the future.
41+
* lib folder for Sveltekit back-end
4242
* Read the [ESP32 Sveltekit docs](https://moonmodules.org/MoonLight/esp32sveltekit/)
4343
* [MoonLight Modules](https://moonmodules.org/MoonLight/moonbase/modules/) e.g. Lights Control, Effects, Info, Channels. They are subclasses of Modules.h/cpp and implement setupDefinition, onUpdate and optional loop. New modules need to be defined in main.cpp and added to menu.svelte. All further UI is generated by Module.svelte.
44-
* src folder for MoonBase and MoonLight vack-end
44+
* src folder for MoonBase and MoonLight back-end
4545
* **MoonLight Nodes**: the easiest and recommended way. See Effects.h, Layouts.h, Modifiers.h and Drivers.h for examples. They match closest WLED usermods. Each node has controls, a setup and a loop and can be switched on and off. For specific purposes hasOnLayout() and hasModifier() can return true.
4646
* src/MoonLight/nodes
4747

@@ -67,7 +67,7 @@ See [Documentation](https://moonmodules.org/MoonLight/develop/documentation/)
6767

6868
* The upstream MoonLight repo can now process this PR
6969

70-
## Addtional info
70+
## Additional info
7171

7272
### Emoji coding
7373

@@ -88,9 +88,9 @@ See [Documentation](https://moonmodules.org/MoonLight/develop/documentation/)
8888

8989
### UI development server
9090

91-
To ease the frontend development you can deploy the vack-end code on an ESP32 board and pass the websocket and REST API calls through the development server's proxy running on your computer.
91+
To ease the front-end development you can deploy the back-end code on an ESP32 board and pass the websocket and REST API calls through the development server's proxy running on your computer.
9292

93-
This very much speeds up UI development as no flashing to ESP32 is required to test updated UI. Svaing an UI file is enough to see the results!!!
93+
This very much speeds up UI development, as no flashing to the ESP32 is required to test updated UI. Saving a UI file is enough to see the results.
9494

9595
See [Setup Proxy for Development](https://moonmodules.org/MoonLight/gettingstarted/#setup-proxy-for-development) and [development-server](https://moonmodules.org/MoonLight/gettingstarted/#development-server) how to setup.
9696

docs/develop/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ Before changing code, test if the current download of MoonLight is running fine.
180180

181181
### Install nodejs
182182

183-
nodejs is needed if changes on the frontend (UI) are made (interface folder). On each file change, ☑️ or ➡️ will rebuild the UI using nodejs.
183+
nodejs is needed if changes on the front-end (UI) are made (interface folder). On each file change, ☑️ or ➡️ will rebuild the UI using nodejs.
184184

185185
* Windows: if nodejs is not on your system you will get this error:
186186

docs/develop/standardsguidelines.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* The main branch is the source to branch and merge to, no direct code commits to the main branch. As the main branch docs folder is the source for the website, doc changes can be made directly to main.
1010
* Branches from main are made for latest updates and merged back to main when done.
1111
* The src folder is for all MoonBase and MoonLight Nodes and Modules development. No need for UI changes as that is generated for Nodes and Modules. The lib folder is for upstream (Sveltekit). The interface folder is for UI, mainly Sveltekit and Modules and Nodes generic functions.
12-
* A pull request should contain compilable code and tested to not crash the system at minimal and support also boards without PSRAM, e.g. ESP32-D0. Code may be work in progress.
12+
* A pull request should contain compilable code that is tested to, at minimum, not crash the system and also supports boards without PSRAM, e.g. ESP32-D0. Code may be work in progress.
1313

1414
## Describe your PR
1515

@@ -35,7 +35,7 @@ Github will pick up the changes so your PR stays up-to-date.
3535

3636
> [!CAUTION]
3737
> Do not use "force-push" while your PR is open!
38-
> It has many subtle and unexpected consequences on our github repository.
38+
> It has many subtle and unexpected consequences on our GitHub repository.
3939
> For example, we regularly lost review comments when the PR author force-pushes code changes. So, pretty please, do not force-push.
4040
4141
You can find a collection of very useful tips and tricks here: https://github.com/wled-dev/WLED/wiki/How-to-properly-submit-a-PR
@@ -52,10 +52,10 @@ You can find a collection of very useful tips and tricks here: https://github.co
5252
* If you don't feel very confident using English, you can use AI for translating code comments and descriptions into English. AI bots are very good at understanding language. However, always check if the results is correct. The translation might still have wrong technical terms, or errors in some details.
5353

5454
### best practice with AI:
55-
* As the person who contributes source code to MoonLight, make sure you understand exactly what the AI generated code does
56-
* best practice: add a comment like ``'// below section of my code was generated by an AI``, when larger parts of your source code were not written by you personally.
55+
* As the person who contributes source code to MoonLight, make sure you understand exactly what the AI-generated code does
56+
@@ * best practice: add a comment like ``'// below section of my code was generated by an AI``, when larger parts of your source code were not written by you personally.
5757
* always review translations and code comments for correctness
58-
* always review AI generated source code
58+
* always review AI-generated source code
5959
* If the AI has rewritten existing code, check that the change is necessary and that nothing has been lost or broken. Also check that previous code comments are still intact.
6060

6161
## Code style
@@ -64,7 +64,7 @@ You can find a collection of very useful tips and tricks here: https://github.co
6464

6565
We use Clang-format for c-files (see .clang-format in the repo for the definition) and Prettier for front-end files.
6666

67-
Right click Format Document on each file you edit before committing.
67+
Right-click Format Document on each file you edit before committing.
6868

6969
### Comments
7070

interface/src/lib/components/moonbase/MultiRow.svelte

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,14 @@
4848
}
4949
}
5050
51-
function handleReorder(reorderedItems: any[]) {
51+
function handleReorder(reorderedItems: { item: any; originalIndex: number }[]) {
5252
console.log('handleReorder', property.name, reorderedItems);
53-
data[property.name] = reorderedItems.map((wrapper: any) => wrapper.item);
53+
const full = [...data[property.name]];
54+
reorderedItems.forEach(({ item }, pos) => {
55+
const originalIndex = filteredItems[pos].originalIndex;
56+
full[originalIndex] = item;
57+
});
58+
data[property.name] = full;
5459
onChange();
5560
}
5661
@@ -98,11 +103,15 @@
98103
const query = (isNegated ? filterValue.slice(1) : filterValue).toLowerCase();
99104
100105
// No filter or empty query → return items directly
101-
if (!query) return data[property.name].map((item: any) => ({ item }));
106+
if (!query)
107+
return data[property.name].map((item: any, index: number) => ({
108+
item,
109+
originalIndex: index
110+
}));
102111
103112
// Filtered items
104113
return data[property.name]
105-
.map((item: any) => ({ item }))
114+
.map((item: any, index: number) => ({ item, originalIndex: index }))
106115
.filter(({ item }: { item: any }) => {
107116
const matchFound = property.n.slice(0, 3).some((propertyN: any) => {
108117
let valueStr;

0 commit comments

Comments
 (0)