Skip to content

Fix password field text layout calculations#11434

Merged
LeonMatthes merged 4 commits intoslint-ui:masterfrom
LeonMatthes:lm/11401-password-field-fixes
Apr 20, 2026
Merged

Fix password field text layout calculations#11434
LeonMatthes merged 4 commits intoslint-ui:masterfrom
LeonMatthes:lm/11401-password-field-fixes

Conversation

@LeonMatthes
Copy link
Copy Markdown
Member

@LeonMatthes LeonMatthes commented Apr 17, 2026

  • Fix offset/size calculations on password TextInput
  • Use SharedString in TextInput VisualRepresentation

Closes #11401

@LeonMatthes LeonMatthes force-pushed the lm/11401-password-field-fixes branch from d8d9354 to 50c9884 Compare April 20, 2026 07:44
@LeonMatthes LeonMatthes requested a review from tronical April 20, 2026 07:49
Copy link
Copy Markdown
Member

@tronical tronical left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall - thanks :).

Comment thread tests/cases/text/input_type_password.slint Outdated
Comment thread tests/cases/text/input_type_password.slint
Comment thread tests/cases/text/input_type_password.slint Outdated
Comment thread tests/cases/text/input_type_password.slint Outdated
Comment thread tests/cases/text/input_type_password.slint Outdated
Comment thread internal/core/items/text.rs Outdated
Comment thread internal/core/items/text.rs Outdated
Comment thread tests/cases/text/input_type_password.slint Outdated
@LeonMatthes LeonMatthes enabled auto-merge (squash) April 20, 2026 09:21
@LeonMatthes LeonMatthes disabled auto-merge April 20, 2026 09:21
Comment thread tests/cases/text/input_type_password.slint Outdated
The shared parley implementation did not use the visual_representation
consistently everywhere.

Closes slint-ui#11401
This should avoid allocations in most cases.
@LeonMatthes LeonMatthes force-pushed the lm/11401-password-field-fixes branch 2 times, most recently from f89f15b to 1ea5ab6 Compare April 20, 2026 09:26
@LeonMatthes LeonMatthes enabled auto-merge (squash) April 20, 2026 09:27
The password character is currently not part of our theme font, so we
don't actually know its size as a constant.
@LeonMatthes LeonMatthes force-pushed the lm/11401-password-field-fixes branch from 1ea5ab6 to e270e27 Compare April 20, 2026 09:44
@LeonMatthes LeonMatthes merged commit 334cda7 into slint-ui:master Apr 20, 2026
46 checks passed
eira-fransham added a commit that referenced this pull request Apr 21, 2026
* Fix partial renderer culling items under scale/rotate transforms

- `PartialRenderer::filter_item` used only `translation()` (a simple vector offset) to map item bounds to screen coordinates for dirty-region culling, ignoring scale and rotation transforms entirely
- Items under `transform-scale < 1` with large local coordinates were incorrectly computed as outside the dirty region and culled — even on full repaints when partial rendering was enabled
- Track the full `ItemTransform` (affine transform) in the renderers, updating it in `translate`/`scale`/`rotate`/`save_state`/`restore_state`, and use `outer_transformed_rect` in `filter_item` to correctly map geometry to screen space via the new accessor that replaces `translation()`.

* build(deps): bump the npm-patch-updates group with 6 updates (#11446)

Bumps the npm-patch-updates group with 6 updates:

| Package | From | To |
| --- | --- | --- |
| [@napi-rs/cli](https://github.com/napi-rs/napi-rs) | `3.6.1` | `3.6.2` |
| [vite-plugin-singlefile](https://github.com/richardtallent/vite-plugin-singlefile) | `2.3.2` | `2.3.3` |
| [@astrojs/partytown](https://github.com/withastro/astro/tree/HEAD/packages/integrations/partytown) | `2.1.6` | `2.1.7` |
| [@biomejs/biome](https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome) | `2.4.11` | `2.4.12` |
| [astro](https://github.com/withastro/astro/tree/HEAD/packages/astro) | `6.1.5` | `6.1.8` |
| [typescript](https://github.com/microsoft/TypeScript) | `6.0.2` | `6.0.3` |


Updates `@napi-rs/cli` from 3.6.1 to 3.6.2
- [Release notes](https://github.com/napi-rs/napi-rs/releases)
- [Commits](https://github.com/napi-rs/napi-rs/compare/@napi-rs/cli@3.6.1...@napi-rs/cli@3.6.2)

Updates `vite-plugin-singlefile` from 2.3.2 to 2.3.3
- [Release notes](https://github.com/richardtallent/vite-plugin-singlefile/releases)
- [Changelog](https://github.com/richardtallent/vite-plugin-singlefile/blob/main/CHANGELOG.md)
- [Commits](https://github.com/richardtallent/vite-plugin-singlefile/commits)

Updates `@astrojs/partytown` from 2.1.6 to 2.1.7
- [Release notes](https://github.com/withastro/astro/releases)
- [Changelog](https://github.com/withastro/astro/blob/main/packages/integrations/partytown/CHANGELOG.md)
- [Commits](https://github.com/withastro/astro/commits/@astrojs/partytown@2.1.7/packages/integrations/partytown)

Updates `@biomejs/biome` from 2.4.11 to 2.4.12
- [Release notes](https://github.com/biomejs/biome/releases)
- [Changelog](https://github.com/biomejs/biome/blob/main/packages/@biomejs/biome/CHANGELOG.md)
- [Commits](https://github.com/biomejs/biome/commits/@biomejs/biome@2.4.12/packages/@biomejs/biome)

Updates `astro` from 6.1.5 to 6.1.8
- [Release notes](https://github.com/withastro/astro/releases)
- [Changelog](https://github.com/withastro/astro/blob/main/packages/astro/CHANGELOG.md)
- [Commits](https://github.com/withastro/astro/commits/astro@6.1.8/packages/astro)

Updates `typescript` from 6.0.2 to 6.0.3
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Commits](microsoft/TypeScript@v6.0.2...v6.0.3)

---
updated-dependencies:
- dependency-name: "@napi-rs/cli"
  dependency-version: 3.6.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-patch-updates
- dependency-name: vite-plugin-singlefile
  dependency-version: 2.3.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-patch-updates
- dependency-name: "@astrojs/partytown"
  dependency-version: 2.1.7
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-patch-updates
- dependency-name: "@biomejs/biome"
  dependency-version: 2.4.12
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-patch-updates
- dependency-name: astro
  dependency-version: 6.1.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-patch-updates
- dependency-name: typescript
  dependency-version: 6.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-patch-updates
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix password field text layout calculations (#11434)

* Fix offset/size calculations on password TextInput

The shared parley implementation did not use the visual_representation
consistently everywhere.

Closes #11401

* Use SharedString in TextInput  VisualRepresentation

This should avoid allocations in most cases.

* Incorporate feedback by @tronical

* Calculate password character size instead of const

The password character is currently not part of our theme font, so we
don't actually know its size as a constant.

* docs: serve plain-markdown sibling for every doc page

Lets AI agents fetch /docs/.../foo.md instead of the HTML page,
saving tokens on retrieval. Implemented as a static Astro endpoint
over the docs collection, so it works the same on Cloudflare Pages
and Netlify with no per-host routing.

* docs: resolve <Link> components and validate links in .md output

The markdown sibling endpoint now resolves the <Link/> component into
a real markdown link pointing at the target page's .md sibling, so AI
agents can chain markdown fetches without rewriting URLs.

Two safety nets keep the output honest:

- A Playwright spec asserts no unresolved MDX components leak into any
  built .md file.
- A post-build script walks the .md corpus with remark and verifies
  every internal link points at an existing file. Wired into the build
  step so a broken link fails the build.

* Extracted preview protocol out of the LSP (#11251)

Extracted preview protocol out of the LSP, so it can be used by other crates.

* servo: Update README and improve code (#11447)

* refactor: use wgpu re-exported from slint and remove redundant wgpu-hal/wgpu dependencies

* refactor: improve lib

* docs: Update README for new implementation

* refactor: move get_wgpu_texture_from_metal from GPURenderingContext to metal module extension trait

* refactor: fix wgpu_hal import to wpgu::hal from slint

* hal

* refactor: decouple android and linux gpu rendering context configurations to support platform-specific API detection

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* testing: replace generational-arena with slotmap

Migrate the testing backend introspection handle storage from generational-arena to slotmap.

This removes the unmaintained generational-arena dependency from the internal testing backend while keeping the existing handle serialization format used by the MCP and system-testing APIs.

* [autofix.ci] apply automated fixes

* testing: reject malformed slotmap handles

Reject malformed wire handles before they reach slotmap so even generations and oversized parts do not normalize into live keys. This fixes the broken slotmap migration roundtrip test, propagates invalid-handle errors through the MCP and system-testing paths, and adds focused coverage for malformed handle decoding.

* esp-idf: Work around bug in xtensa toolchain

Pin release to 1.94.0 due to esp-rs/rust#276

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Till Adam <till.adam@kdab.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Leon Matthes <leon.matthes@slint.dev>
Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
Co-authored-by: Andreas Monitzer <andreas.monitzer@slint.dev>
Co-authored-by: Burhan Khanzada <burhan.khanzada@slint.dev>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: lainon1 <271530700+lainon1@users.noreply.github.com>
@ogoffart ogoffart added the candidate-for-bugfix-release Label for PRs that would make sense to cherry-pick into a spontaneously created bug fix release bran label Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

candidate-for-bugfix-release Label for PRs that would make sense to cherry-pick into a spontaneously created bug fix release bran

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Password input field behaves incorrectly with mouse actions

3 participants