We were triggering webserver events in Kernel. This change improves
adherence to separation-of-concerns and ensures event cascading is
working as expected. This also better formalizes the boot sequence.
Every user previously set the max_length as window.TRUNCATE_LENGTH, so
I've moved that constant into the truncate_filename file and set it as
the default if max_length is not specified.
Most of the time, we'll already have a TaskManagerRow for the given
process, so we can just update its properties.
Iterating the results from #iter_tasks means we also insert the rows in
the correct order, regardless of their previous order.
If the Component gets removed from the DOM and then re-added, it already
has contents, and we don't need to create them again. It also has
already had on_ready called, so that doesn't need to happen again
either.
This fix stops Components duplicating their content elements and
listener callbacks whenever they're moved around the document.
This currently behaves the same as it did before: It still recreates the
table contents every half a second. It should also look identical,
though it's possible I missed some small differences.
The component structure is:
TaskManagerTable
- Table
- TaskManagerRow
- TaskManagerRow
- TaskManagerRow
- ...
TaskManagerRow is implemented so that we can later move to modifying
them in place as the process tree changes, instead of having to replace
them all.
Otherwise, most of the code is just moved around, and not changed much.
The object returned from UIWindowProgress() now has a `show_error()`
method, taking a title and message. Calling it will replace the content
of the window with those messages.
I've made use of this for file uploads. The only other place we
currently have errors we could show is for zipping and downloading
files, but we do not always have a progress dialog in that case, so I'll
leave that for now.
I think ideally, we would always create a progress dialog, and it would
then support being invisible initially, but appearing after a delay.
Then we'd always have an object to call `show_error()` on, and it could
then immediately show the dialog. But I'll get to that another day. :^)
Previously we showed "Moving /foo" which was confusing.
Also, make use of i18n replacements instead of gluing strings together,
because other languages might put the words in a different order. For
now, I've modified all the translations so that the "Moving foo" text
will appear as it did before, but these will require someone who
actually knows the different languages to check and correct them.
I noticed during this that emptying the trash from inside the Trash
window uses a different code path without a progress dialog, so I've
added a TODO to merge that in. I tried just using it directly but the
behaviour is a bit different. (The Trash one makes all the items fade
out.)
Run the ESLint static analysis tool on any code that is submitted, to
find possible bugs such as undefined functions and variables. We may
want to adjust the ESLint settings over time, but this seems like a
good start.
This is merged into the previous check-translations.yml action, because
that's also a form of linting. Possibly that could be reimplemented as
an ESLint plugin.
These two seem like bugs but are unclear to me how to fix, so I've added
FIXMEs.
/puter/packages/backend/src/routers/kvstore/clearItems.js
41:32 error 'DB_MODE_WRITE' is not defined no-undef
/puter/packages/backend/src/routers/whoami.js
104:35 error 'db' is not defined no-undef
/puter/src/UI/Settings/UITabSecurity.js
13:13 error 'user' is not defined no-undef
31:13 error 'user' is not defined no-undef
32:70 error 'user' is not defined no-undef
36:30 error 'user' is not defined no-undef
40:82 error 'user' is not defined no-undef
41:83 error 'user' is not defined no-undef
87:41 error 'api_origin' is not defined no-undef
/puter/src/UI/UIWindow2FASetup.js
39:33 error 'api_origin' is not defined no-undef
51:37 error 'api_origin' is not defined no-undef
69:37 error 'api_origin' is not defined no-undef
/puter/src/UI/UIWindowLogin.js
202:73 error 'api_origin' is not defined no-undef
271:73 error 'api_origin' is not defined no-undef