Handing an item view a new JS array is a model swap: every delegate is thrown away, the scroll offset resets and the page is built again. QbzKeyedModel takes the same arrays and reconciles them by key into removes, inserts, moves and in-place updates, so a view keeps its delegates, its offset and its artwork, and a leaving row can fade out while its neighbours slide into the gap. Each model row carries only `rowKey` and `rowRev`; a delegate looks the row up by key, so it reads the host's own JS object (no copy into a ListModel map) and a rev bump hands it a changed row. New objects for an existing key are compared field by field, so a republished document with the same data touches no delegate. A reorder keeps the longest in-order run steady and moves only the rest; past a cap, and on any scope change (tab, sort, search), the rows are replaced without animation, laid out synchronously and started from the top, like the swap they replace. Three shared transitions (add, remove, displaced) give every adopter the same motion. The remove transition restores opacity and scale as its last step: the view pools a delegate the moment the transition ends and hands it back as it was left, which measured 76 invisible rows after three removals and a scroll. tst_keyed_model covers order and identity under 400 random edits, the one-move reorder, silent resets, a removal that keeps the viewport and creates at most two delegates, the fade that keeps its content, and the pooled rows; it runs in the runtime gate. cc
35 lines
1.5 KiB
Bash
35 lines
1.5 KiB
Bash
#!/usr/bin/env bash
|
|
# Shared Linux CI/local runtime gate. Serial builds, no personal profile.
|
|
set -euo pipefail
|
|
cd "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.."
|
|
export QBZ_PREBUILT_SHADERS=1
|
|
bash scripts/test-search-local-qml.sh
|
|
bash scripts/test-updates-qml.sh
|
|
bash scripts/test-playback-cache-qml.sh
|
|
bash scripts/test-text-edit-menu-qml.sh
|
|
bash scripts/test-compact-seek-qml.sh
|
|
bash scripts/test-library-folders-qml.sh
|
|
bash scripts/test-array-model-qml.sh
|
|
bash scripts/test-keyed-model-qml.sh
|
|
bash scripts/test-card-menu-qml.sh
|
|
bash scripts/test-orbit-qml.sh
|
|
node scripts/test_qt_local_views.mjs
|
|
node scripts/test_qt_library.mjs
|
|
node scripts/test_qt_purchases_navigation.mjs
|
|
node scripts/test_qt_kiosk_art.mjs
|
|
node scripts/test_qt_kiosk_navigation.mjs
|
|
node scripts/test_qt_kiosk_feedback.mjs
|
|
node scripts/test_qt_exclusive_gate.mjs
|
|
python3 scripts/qt-cargo.py test --manifest-path crates/Cargo.toml -p qbz-qt --no-fail-fast
|
|
target_dir="${CARGO_TARGET_DIR:-$PWD/crates/target}"
|
|
logs="$(mktemp -d "${TMPDIR:-/tmp}/qbz-qt-gate-XXXXXX")"
|
|
printf '[qt-gate] startup logs: %s\n' "$logs"
|
|
for profile in debug release; do
|
|
args=()
|
|
[[ "$profile" == release ]] && args=(--release)
|
|
python3 scripts/qt-cargo.py build "${args[@]}" --manifest-path crates/Cargo.toml -p qbz-qt
|
|
python3 scripts/qt-smoke.py "$target_dir/$profile/qbz" --log "$logs/$profile.log"
|
|
done
|
|
# A healthy offscreen bus cannot expose Qt's synchronous xcb D-Bus startup.
|
|
python3 scripts/qt-smoke.py "$target_dir/release/qbz" --silent-bus --log "$logs/release-silent-bus.log"
|