Unify vertical position and display mode settings; add to onboarding

This commit is contained in:
James Babcock committed 2026-10-10 22:48:26 -07:00
1 parent 6b1e64c5ac
commit 5a9ca08921
36 files changed
+810 -574

No files matched your search

+6 -3
View File
@@ -10,8 +10,8 @@ function fixture() {
}
const settings = {
brightnessSetting: { get: () => brightness, set: value => { brightness = value; writes.push(value); } },
displayModeSetting: { get: () => mode, set: value => { mode = value; } },
DISPLAY_MODE_VALUES: ['small', 'large'], displayModeLabel: value => value === 'small' ? 'Small' : 'Large',
displayLayoutSetting: { get: () => mode, set: value => { mode = value; }, values: ['small', 'large', 'huge'],
isDisabled: value => value === 'huge', displayValue(value = mode) { return value[0].toUpperCase() + value.slice(1); } },
};
const { RemoteControlsViewModel } = loader({}, {
'@nativescript/core': { Observable, Dialogs: { action: async () => picked } },
@@ -51,10 +51,13 @@ test('shared brightness controls snap manual levels and restore the manual value
assert.equal(h.brightness(), '2');
});
test('shared screen-size picker preserves cancellation and applies the selected mode', async () => {
test('shared display-mode picker preserves cancellation and applies the selected mode', async () => {
const h = fixture();
h.pick('Cancel'); await h.model.onDisplayModeTap();
assert.equal(h.mode(), 'small');
// Unavailable modes (Full Screen beside a side strip) are not offered.
h.pick('Huge'); await h.model.onDisplayModeTap();
assert.equal(h.mode(), 'small');
h.pick('Large'); await h.model.onDisplayModeTap();
assert.equal(h.mode(), 'large');
assert.equal(h.model.displayModeLabel, 'Large ▾');