]> git.proxmox.com Git - ui/proxmox-yew-widget-toolkit.git/log
ui/proxmox-yew-widget-toolkit.git
2 weeks agotree wide: apply auto-appliable clippy fix-ups
Shannon Sterz [Fri, 3 Jan 2025 10:26:25 +0000 (11:26 +0100)]
tree wide: apply auto-appliable clippy fix-ups

this mostly includes:

- switching from `Into` to `From` implementations as that also provides
  an `Into` implementation for "free"
- adding `Default` implementations where possible (e.g. if a `new`
  function without parameters exists)
- removing unnecessary reference and dereference operations (e.g. if the
  compiler would do that automatically anyway)
- using more idiomatic syntax (e.g. using `contains` instead of `<` and
  `>=` operators)
- removing closures where they aren't necessary
- removing `format!` macros where `to_string()` would do to improve
  performance
- remove unnecessary convertions and into calls

these should not change the semantics of the exists code itself, so
there are no breaking changes. however, adding `Default` implementations
and such, does add new public APIs for some types.

2 weeks agogettext_wrapper: run rustfmt
Shannon Sterz [Fri, 3 Jan 2025 08:56:01 +0000 (09:56 +0100)]
gettext_wrapper: run rustfmt

4 weeks agowidget: dropdown: update picker placement after showing
Dominik Csapak [Fri, 20 Dec 2024 10:31:39 +0000 (11:31 +0100)]
widget: dropdown: update picker placement after showing

It seems that under certain circumstances (e.g. a dropdown in a
dialog) updating the position of the picker before it's opened (it's a
popover) does not work properly in safari/webkit/epiphany.

When trying to open such a dropdown, it (or some parts of it) would be
rendered with a height of 0px, even though the elements have a height
set explicitly.

To fix this, update the picker placement after opening it. What
exactly is the cause (e.g. if it's a browser bug or our css/aligning)
is yet to be determined.

This fixes an issue on webkit (tested with epiphany) that opening
dropdowns in a dialog did not show the dropdown properly.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
 [ TL: extend comment to mention webkit explicitly ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 weeks agobump version to 0.4.6
Thomas Lamprecht [Thu, 19 Dec 2024 12:25:17 +0000 (13:25 +0100)]
bump version to 0.4.6

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 weeks agowhitepaper: fix some typos
Thomas Lamprecht [Thu, 19 Dec 2024 12:24:35 +0000 (13:24 +0100)]
whitepaper: fix some typos

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 weeks agowidget: input panel: use correct column for custom childs
Dominik Csapak [Thu, 19 Dec 2024 12:09:16 +0000 (13:09 +0100)]
widget: input panel: use correct column for custom childs

we added a 'padding column' recently, and we forgot to adapt
the custom childs for that.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 weeks agowhitepaper: re-flow text to 80 cc width
Thomas Lamprecht [Thu, 19 Dec 2024 11:13:16 +0000 (12:13 +0100)]
whitepaper: re-flow text to 80 cc width

Wrap at a consistent text-width of 80 character columns, that is
a relatively standard width for prose and a good balance for having
more context visible at the same time while not requiring to much neck
moving.

Also fix a unclosed code-block by adding the third backtick

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 weeks agoreadme: re-wrap to 80cc and small fixes
Thomas Lamprecht [Thu, 19 Dec 2024 11:22:02 +0000 (12:22 +0100)]
readme: re-wrap to 80cc and small fixes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 weeks agobump version to 0.4.5
Thomas Lamprecht [Wed, 18 Dec 2024 14:40:32 +0000 (15:40 +0100)]
bump version to 0.4.5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 weeks agowidget: display: don't set inital value
Dominik Csapak [Wed, 18 Dec 2024 14:25:08 +0000 (15:25 +0100)]
widget: display: don't set inital value

when doing that, a new value that is set via `new` won't get used as a
value anymore, which is undesired. only use the value for the default,
which was the original intenion.

This fixes an issue where the value of a display field changes after the
first creation and would not update it's displayed value.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 weeks agobump version to 0.4.4
Thomas Lamprecht [Wed, 18 Dec 2024 13:40:30 +0000 (14:40 +0100)]
bump version to 0.4.4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 weeks agowidget: add ConfirmDialog
Shannon Sterz [Wed, 18 Dec 2024 12:14:58 +0000 (13:14 +0100)]
widget: add ConfirmDialog

this is a dialog that allows for confirming or canceling an action
easily.

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
4 weeks agocatalog_loader: don't try to load the catalog if the language is empty
Shannon Sterz [Tue, 17 Dec 2024 15:09:46 +0000 (16:09 +0100)]
catalog_loader: don't try to load the catalog if the language is empty

this means that the Language value in the local storage is not set. by
default this would try to load `catalog-.mo` as language is an empty
string, so just skip trying to load something here and simply initialize
with an empty catalog instead, avoiding a failed load.

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
4 weeks agowidget: button: use 'fa-spin' for refresh icon
Dominik Csapak [Tue, 17 Dec 2024 15:15:15 +0000 (16:15 +0100)]
widget: button: use 'fa-spin' for refresh icon

instead of loading icon, since the change is too jarring

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 weeks agobump version to 0.4.3
Dietmar Maurer [Tue, 17 Dec 2024 11:55:00 +0000 (12:55 +0100)]
bump version to 0.4.3

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 weeks agobuildsys: simplify upload target, add missing uses for BUILDDIR
Thomas Lamprecht [Tue, 17 Dec 2024 11:48:51 +0000 (12:48 +0100)]
buildsys: simplify upload target, add missing uses for BUILDDIR

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 weeks agofocus: move code to dom module
Dietmar Maurer [Tue, 17 Dec 2024 11:14:14 +0000 (12:14 +0100)]
focus: move code to dom module

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 weeks agoalign: move code to dom module
Dietmar Maurer [Tue, 17 Dec 2024 11:05:57 +0000 (12:05 +0100)]
align: move code to dom module

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 weeks agocolumn: derive Properties instead of Default
Dietmar Maurer [Tue, 17 Dec 2024 10:55:58 +0000 (11:55 +0100)]
column: derive Properties instead of Default

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 weeks agocard: derive Properties instead of Default
Dietmar Maurer [Tue, 17 Dec 2024 10:54:19 +0000 (11:54 +0100)]
card: derive Properties instead of Default

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 weeks agobuildsys: add upload target
Thomas Lamprecht [Tue, 17 Dec 2024 10:53:25 +0000 (11:53 +0100)]
buildsys: add upload target

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 weeks agobuildsys: add DEBS and BUILDDIR variables
Thomas Lamprecht [Tue, 17 Dec 2024 10:52:51 +0000 (11:52 +0100)]
buildsys: add DEBS and BUILDDIR variables

Make it a bit more complete and allow overriding the BUILDDIR one from
the outside.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 weeks agoimprove docs
Dietmar Maurer [Tue, 17 Dec 2024 10:48:10 +0000 (11:48 +0100)]
improve docs

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 weeks agoimprove size observer docs
Dietmar Maurer [Tue, 17 Dec 2024 10:37:29 +0000 (11:37 +0100)]
improve size observer docs

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 weeks agorow: derive Properties instead of Default
Dietmar Maurer [Tue, 17 Dec 2024 10:31:11 +0000 (11:31 +0100)]
row: derive Properties instead of Default

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 weeks agovisibility observer: remove unused generic parameter, improve docs
Dietmar Maurer [Tue, 17 Dec 2024 10:27:44 +0000 (11:27 +0100)]
visibility observer: remove unused generic parameter, improve docs

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 weeks agopanel: derive Properties instead of Default
Dietmar Maurer [Tue, 17 Dec 2024 10:23:57 +0000 (11:23 +0100)]
panel: derive Properties instead of Default

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 weeks agobump version to 0.4.2
Dietmar Maurer [Tue, 17 Dec 2024 08:38:40 +0000 (09:38 +0100)]
bump version to 0.4.2

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 weeks agopwt-macros: bump version 0.3.0
Dietmar Maurer [Tue, 17 Dec 2024 08:34:15 +0000 (09:34 +0100)]
pwt-macros: bump version 0.3.0

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 weeks agoadd real VisibilityObserver component
Dietmar Maurer [Mon, 16 Dec 2024 17:40:37 +0000 (18:40 +0100)]
add real VisibilityObserver component

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 weeks agorename VisibilityObserver to DomVisibilityObserver
Dietmar Maurer [Mon, 16 Dec 2024 17:22:22 +0000 (18:22 +0100)]
rename VisibilityObserver to DomVisibilityObserver

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 weeks agolist: use new SizeObserver component
Dietmar Maurer [Mon, 16 Dec 2024 12:38:19 +0000 (13:38 +0100)]
list: use new SizeObserver component

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 weeks agoadd real SizeObserver component
Dietmar Maurer [Mon, 16 Dec 2024 11:05:17 +0000 (12:05 +0100)]
add real SizeObserver component

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 weeks agorename SizeObserver to DomSizeObserver
Dietmar Maurer [Sun, 15 Dec 2024 15:27:30 +0000 (16:27 +0100)]
rename SizeObserver to DomSizeObserver

And move it into the dom module.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 weeks agobump version to 0.4.1
Thomas Lamprecht [Mon, 16 Dec 2024 13:30:42 +0000 (14:30 +0100)]
bump version to 0.4.1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 weeks agostyle fix line-length and formatting in various doc-comments
Thomas Lamprecht [Mon, 16 Dec 2024 13:38:00 +0000 (14:38 +0100)]
style fix line-length and formatting in various doc-comments

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 weeks agocleanup: remove unused code
Dietmar Maurer [Mon, 16 Dec 2024 17:01:35 +0000 (18:01 +0100)]
cleanup: remove unused code

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 weeks agowidget: data table: beter handle navigation input
Dominik Csapak [Mon, 16 Dec 2024 13:18:38 +0000 (14:18 +0100)]
widget: data table: beter handle navigation input

when inside a cell, we generally want to navigate with arrow keys,
except if we're inside an input element. In that case, use tab/shift+tab
to navigate out and don't catch arrows/space to allow navigation within
the input field (and input a space).

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 weeks agoreadme: fix future git repo url
Thomas Lamprecht [Mon, 16 Dec 2024 11:21:44 +0000 (12:21 +0100)]
readme: fix future git repo url

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 weeks agoreflow some doc-comments to use full 100cc width
Thomas Lamprecht [Mon, 16 Dec 2024 11:21:07 +0000 (12:21 +0100)]
reflow some doc-comments to use full 100cc width

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 weeks agotree wide: remove debug log statements
Dominik Csapak [Mon, 16 Dec 2024 09:09:10 +0000 (10:09 +0100)]
tree wide: remove debug log statements

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 weeks agocheck in generated d/control files
Thomas Lamprecht [Sun, 15 Dec 2024 14:01:26 +0000 (15:01 +0100)]
check in generated d/control files

Makes it a bit easier to bootstrap and also see what changed w.r.t.
dependencies and meta information

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 weeks agobuildsys: wrap debcargo command over multiple lines
Thomas Lamprecht [Sun, 15 Dec 2024 14:07:02 +0000 (15:07 +0100)]
buildsys: wrap debcargo command over multiple lines

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 weeks agolist: make number of prefetched rows configurable
Dietmar Maurer [Sun, 15 Dec 2024 10:44:25 +0000 (11:44 +0100)]
list: make number of prefetched rows configurable

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 weeks agotheme density: rework naming to more telling variants
Thomas Lamprecht [Sat, 14 Dec 2024 12:58:52 +0000 (13:58 +0100)]
theme density: rework naming to more telling variants

Rework the naming and doc comments of the theme density type but
include backward compatibility for the old variants when parsing the
density from a string. There's nothing to adapt on the actual UI
examples or products.

The bigger improvement is avoiding "Auto" for the default theme
spacing/density, as "auto" is widely used for something that
dynamically adapts on some environment aspects. But all our themes do
not have any such queries for high/low dpi or screen width to choose a
fitting spacing dynamically. Use `Preset` to avoid clashing with the
widely used `Default` trait from the rust std lib, albeit we could use
that if we really want.

The smaller fine tuning is renaming "High" to "Compact" and "Touch" to
"Relaxed".
The reasoning for the first is that most people, including our user
base, does not work with density a lot in their every day life, be it
physical density or screen density, so "higher density", while
definitively correct for what it does, is not that intuitive, i.e.
when "higher" makes things "smaller" we have a sort of double-negation
that is almost never good to have for UX.
The reasoning for the second (Touch -> Relaxed) is that this is not
doing anything with touch directly, it just might correlate with that
use case, and coupling a setting name with one specific use case is a
bit confusing for peoples coming from other use cases, like simply
having a higher DPI but not doing desktop wide scaling.

Note the naming was initially suggested by me with Thunderbird as
example, so this is really just improving on my own short comings from
the past. It also seems that newer Thunderbird Versions (e.g., latest
134.0b4) changed the wording to something similar than we now have
after this commit.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 weeks agopwt-macros: bump version to 0.2.0
Dietmar Maurer [Fri, 13 Dec 2024 16:32:46 +0000 (17:32 +0100)]
pwt-macros: bump version to 0.2.0

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 weeks agofix debian release name
Dietmar Maurer [Fri, 13 Dec 2024 16:29:51 +0000 (17:29 +0100)]
fix debian release name

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 weeks agobump version to 0.4.0
Dietmar Maurer [Fri, 13 Dec 2024 16:24:43 +0000 (17:24 +0100)]
bump version to 0.4.0

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 weeks agowidget: meter: add 'animated' flag
Dominik Csapak [Fri, 13 Dec 2024 14:53:29 +0000 (15:53 +0100)]
widget: meter: add 'animated' flag

for adding the 'pwt-animated' class that animates the value transitions.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 weeks agolist: also hide sparator behind wrapper
Dietmar Maurer [Fri, 13 Dec 2024 11:52:07 +0000 (12:52 +0100)]
list: also hide sparator behind wrapper

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 weeks agolist: cleanup: avoid compiler warnings
Dietmar Maurer [Fri, 13 Dec 2024 11:33:32 +0000 (12:33 +0100)]
list: cleanup: avoid compiler warnings

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 weeks agocss: add rust enum for font style
Dominik Csapak [Fri, 13 Dec 2024 10:14:41 +0000 (11:14 +0100)]
css: add rust enum for font style

so we can write `FontStyle::DisplaySmall` instead of
`pwt-font-display-small` and get compile time checks.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 weeks agolist: remove key property, because it is already in the standard widget properties
Dietmar Maurer [Fri, 13 Dec 2024 10:45:04 +0000 (11:45 +0100)]
list: remove key property, because it is already in the standard widget properties

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 weeks agolist: add separator property
Dietmar Maurer [Fri, 13 Dec 2024 08:43:13 +0000 (09:43 +0100)]
list: add separator property

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 weeks agolist: split out list tile observer code
Dietmar Maurer [Fri, 13 Dec 2024 08:26:34 +0000 (09:26 +0100)]
list: split out list tile observer code

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 weeks agolist: use list tiles with forcable height
Dietmar Maurer [Fri, 13 Dec 2024 06:57:07 +0000 (07:57 +0100)]
list: use list tiles with forcable height

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 weeks agolist: remove separator property to simplify development
Dietmar Maurer [Thu, 12 Dec 2024 10:37:21 +0000 (11:37 +0100)]
list: remove separator property to simplify development

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 weeks agolist tile: add force_height property
Dietmar Maurer [Thu, 12 Dec 2024 07:14:52 +0000 (08:14 +0100)]
list tile: add force_height property

This restricts the used container height, but still renders the tile with full
height so that we still get resize events with the correct size.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 weeks agotab: change default style to MaterialPrimary
Dietmar Maurer [Thu, 12 Dec 2024 08:55:59 +0000 (09:55 +0100)]
tab: change default style to MaterialPrimary

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 weeks agolist: add ARIA roles
Dietmar Maurer [Tue, 10 Dec 2024 12:29:39 +0000 (13:29 +0100)]
list: add ARIA roles

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 weeks agocleanup: list: remove unused code, use better names
Dietmar Maurer [Tue, 10 Dec 2024 11:26:39 +0000 (12:26 +0100)]
cleanup: list: remove unused code, use better names

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 weeks agolist: compute tail height
Dietmar Maurer [Tue, 10 Dec 2024 11:12:32 +0000 (12:12 +0100)]
list: compute tail height

Instead of using a bad esitimation.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 weeks agolist: fix for missing onscroll event.
Dietmar Maurer [Tue, 10 Dec 2024 09:28:38 +0000 (10:28 +0100)]
list: fix for missing onscroll event.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 weeks agolist: rate limit TileResize events
Dietmar Maurer [Mon, 9 Dec 2024 13:24:53 +0000 (14:24 +0100)]
list: rate limit TileResize events

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 weeks agolist: observe tile resizes
Dietmar Maurer [Mon, 9 Dec 2024 11:52:37 +0000 (12:52 +0100)]
list: observe tile resizes

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 weeks agolist_tile: add resize_callback
Dietmar Maurer [Mon, 9 Dec 2024 11:10:53 +0000 (12:10 +0100)]
list_tile: add resize_callback

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 weeks agolist: improve inline docs
Dietmar Maurer [Sun, 8 Dec 2024 15:36:43 +0000 (16:36 +0100)]
list: improve inline docs

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 weeks agorename ProxmoxLanguageSelector to PwtLanguageSelector
Dietmar Maurer [Sat, 7 Dec 2024 14:14:52 +0000 (15:14 +0100)]
rename ProxmoxLanguageSelector to PwtLanguageSelector

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 weeks agodocs: avoid useless re-export docs
Dietmar Maurer [Sat, 7 Dec 2024 11:00:53 +0000 (12:00 +0100)]
docs: avoid useless re-export docs

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 weeks agolist: improve docs
Dietmar Maurer [Sat, 7 Dec 2024 10:08:19 +0000 (11:08 +0100)]
list: improve docs

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 weeks agodocs: fix compiler warning
Dietmar Maurer [Sat, 7 Dec 2024 09:42:00 +0000 (10:42 +0100)]
docs: fix compiler warning

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 weeks agolist: improve docu
Dietmar Maurer [Sat, 7 Dec 2024 09:33:17 +0000 (10:33 +0100)]
list: improve docu

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 weeks agolist: set scroll_to to correct size estimations
Dietmar Maurer [Fri, 6 Dec 2024 16:04:47 +0000 (17:04 +0100)]
list: set scroll_to to correct size estimations

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 weeks agolist: improve virtual scroll by tracking all tile sizes
Dietmar Maurer [Fri, 6 Dec 2024 08:48:53 +0000 (09:48 +0100)]
list: improve virtual scroll by tracking all tile sizes

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
6 weeks agolanguage: make LANGUAGE thread local
Shannon Sterz [Tue, 3 Dec 2024 11:04:50 +0000 (12:04 +0100)]
language: make LANGUAGE thread local

in rust edition 2024 [1] it is no longer allowed to use references to
`static mut` variables. the recommended way of dealing with this is to
use inner mutability. this usually requires the wrapped trait to
implement `Sync` to be thread safe. however, `SharedState` uses `Rc`s
for its implementation, which do not implement `Sync` and so
`SharedState` cannot be `Sync`.

using `Rc`s in WASM is usually fine as WASM code generally isn't
multi-threaded. there are some ways to exploit parallelism, but they are
fairly limited (e.g. web workers). so following this logic, make
`LANGUAGE` thread local. this will allow us to use edition 2024 without
too many changes.

[1]:
https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
6 weeks agogettext_wrapper: use inner mutability for CATALOG
Shannon Sterz [Tue, 3 Dec 2024 11:04:49 +0000 (12:04 +0100)]
gettext_wrapper: use inner mutability for CATALOG

in the rust edition 2024 [1] `static mut` are not allowed to be
referenced anymore, as doing so has always been undefined behaviour. the
recommended way to work around this is to use inner mutability. so use a
`RWLock` here.

[1]:
https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
6 weeks agolanguage: use inner mutability for AVAILABLE_LANUGAGES
Shannon Sterz [Tue, 3 Dec 2024 11:04:48 +0000 (12:04 +0100)]
language: use inner mutability for AVAILABLE_LANUGAGES

in rust edition 2024 taking references to `static mut` variables will be
disallowed [1]. the recommended way to adapting to this is using inner
mutability. so use a OnceLock here to ensure that the set of available
languages can only be set once.

[1]:
https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
6 weeks agolib: mark unused parameters
Shannon Sterz [Tue, 3 Dec 2024 11:04:47 +0000 (12:04 +0100)]
lib: mark unused parameters

this avoids a compiler warning about unused parameters

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
6 weeks agowidget: form: use value from form ctx if given
Dominik Csapak [Mon, 2 Dec 2024 13:09:43 +0000 (14:09 +0100)]
widget: form: use value from form ctx if given

so that we can use the display field with loaded values too.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 weeks agostate: loader: don't unnecessarily notify listeners
Dominik Csapak [Mon, 2 Dec 2024 13:09:42 +0000 (14:09 +0100)]
state: loader: don't unnecessarily notify listeners

in the `load` method, we just setup the loading itself, but the write
guard does that on every `Drop`. To prevent that and only trigger
the `on_change` callback when the data really changed, combine the
calls to `write()` here so we only have one guard and disable the
notification on it.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 weeks agolist: set overflow-anchor to none
Dietmar Maurer [Tue, 3 Dec 2024 09:17:01 +0000 (10:17 +0100)]
list: set overflow-anchor to none

also see: https://github.com/facebook/react/issues/27044

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
6 weeks agolist: set yew keys on all list items to keep item state
Dietmar Maurer [Sat, 30 Nov 2024 08:41:10 +0000 (09:41 +0100)]
list: set yew keys on all list items to keep item state

And remove unused code.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
6 weeks agodocs: improve list tile example
Dietmar Maurer [Sat, 30 Nov 2024 08:39:33 +0000 (09:39 +0100)]
docs: improve list tile example

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
7 weeks agolist: use grid layout and allow to set grid-template-columns
Dietmar Maurer [Thu, 28 Nov 2024 13:25:46 +0000 (14:25 +0100)]
list: use grid layout and allow to set grid-template-columns

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
7 weeks agoadd new list tile widget
Dietmar Maurer [Wed, 27 Nov 2024 11:56:51 +0000 (12:56 +0100)]
add new list tile widget

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
7 weeks agoadd new list widget with virtual scrolling
Dietmar Maurer [Wed, 27 Nov 2024 08:39:48 +0000 (09:39 +0100)]
add new list widget with virtual scrolling

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
7 weeks agodocs: fix typo
Dietmar Maurer [Wed, 27 Nov 2024 08:16:29 +0000 (09:16 +0100)]
docs: fix typo

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
7 weeks agocleanup: remove unused size observer from data table
Dietmar Maurer [Tue, 26 Nov 2024 11:32:06 +0000 (12:32 +0100)]
cleanup: remove unused size observer from data table

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
7 weeks agocleanup: use style helper
Dietmar Maurer [Tue, 26 Nov 2024 11:18:33 +0000 (12:18 +0100)]
cleanup: use style helper

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
7 weeks agowidget: selector: limit error messages to width of input
Dominik Csapak [Fri, 22 Nov 2024 08:14:22 +0000 (09:14 +0100)]
widget: selector: limit error messages to width of input

but no less than 400px. Otherwise the error message is not bound
in widht, and can take up a very large amount of space horizontally.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
7 weeks agowidget: selector: show load mask when loading
Dominik Csapak [Fri, 22 Nov 2024 08:14:21 +0000 (09:14 +0100)]
widget: selector: show load mask when loading

so the user knows what is happening

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
8 weeks agocleanup: use IntoOptionalKey trait
Dietmar Maurer [Thu, 21 Nov 2024 09:53:19 +0000 (10:53 +0100)]
cleanup: use IntoOptionalKey trait

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
8 weeks agofix doc tests
Dietmar Maurer [Thu, 21 Nov 2024 08:38:52 +0000 (09:38 +0100)]
fix doc tests

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
8 weeks agocombine storage location and state_id
Dietmar Maurer [Wed, 20 Nov 2024 09:31:31 +0000 (10:31 +0100)]
combine storage location and state_id

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
8 weeks agowidget: dropdown: remove unnecessary style
Dominik Csapak [Mon, 18 Nov 2024 12:02:35 +0000 (13:02 +0100)]
widget: dropdown: remove unnecessary style

this did not work anyway because our aligning code removed the overflow
property.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
8 weeks agowidget: dropdown: make popover behavior manual
Dominik Csapak [Mon, 18 Nov 2024 12:02:34 +0000 (13:02 +0100)]
widget: dropdown: make popover behavior manual

otherwise the popover is dismissed by e.g. clicking in the field
when it's editable, which produces an undesired effect.
(It's then "closed" but still visible because of our css classes, and
now our aligning logic is wrong because popovers behave differently when
open vs closed)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
8 weeks agowidget: dropdown: mark non-editable dropdowns with 'readonly' attribute
Dominik Csapak [Mon, 18 Nov 2024 12:02:33 +0000 (13:02 +0100)]
widget: dropdown: mark non-editable dropdowns with 'readonly' attribute

this way some browser behaviors change, like e.g. the text is
not spell-checked (which makes no sense for a non-editable value)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 months agofix previous commit: correctly set focus on the .selected element (not on the picker...
Dietmar Maurer [Mon, 18 Nov 2024 10:22:25 +0000 (11:22 +0100)]
fix previous commit: correctly set focus on the .selected element (not on the picker itself)

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 months agowidget: dropdown: properly focus the selected element
Dominik Csapak [Thu, 14 Nov 2024 14:36:48 +0000 (15:36 +0100)]
widget: dropdown: properly focus the selected element

we currently always have a datatable as a picker, so the selected
element must be the cell, as the row (which gets the 'selected' class)
is not selectable (it has no tabindex)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2 months agowidget: dropdown: use popover instead of a dialog
Dominik Csapak [Thu, 14 Nov 2024 14:36:47 +0000 (15:36 +0100)]
widget: dropdown: use popover instead of a dialog

by using popovers, we don't have get the messy focus behaviour of
dialogs, for example those focus the first element when the dialog is
opened, which often is the header menu of a datatable.

This also makes the code a bit shorter, since we can restore the focus
before the popover is fully closed (and simply hide it as soon as
possible).

for now we have to use our own bindings to show/hide/togglePopover, but
this can be removed with a later web-sys version.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>