mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-07-10 16:49:50 -07:00
feat(notifications): add overlay notifications with position config (#110)
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
resolveDesiredOverlayInteractive,
|
||||
resolveForegroundSuppressionWithGrace,
|
||||
shouldSuppressPointerInteractionForForegroundWindow,
|
||||
shouldPrimeLinuxOverlayInteractionFromMeasurement,
|
||||
tickLinuxOverlayPointerInteraction,
|
||||
} from './linux-overlay-pointer-interaction';
|
||||
|
||||
@@ -136,6 +137,59 @@ test('resolveDesiredOverlayInteractive: hit-tests separate subtitle bars without
|
||||
);
|
||||
});
|
||||
|
||||
test('shouldPrimeLinuxOverlayInteractionFromMeasurement primes input from first measured rect', () => {
|
||||
assert.equal(
|
||||
shouldPrimeLinuxOverlayInteractionFromMeasurement({
|
||||
getVisibleOverlayVisible: () => true,
|
||||
getMainWindow: () => ({
|
||||
isDestroyed: () => false,
|
||||
isVisible: () => true,
|
||||
getBounds: () => BOUNDS,
|
||||
}),
|
||||
getSubtitleMeasurement: () => ({
|
||||
...MEASUREMENT,
|
||||
interactiveRects: [{ x: 900, y: 900, width: 320, height: 80 }],
|
||||
}),
|
||||
shouldSuspend: () => false,
|
||||
shouldSuppressInteraction: () => false,
|
||||
}),
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
test('shouldPrimeLinuxOverlayInteractionFromMeasurement skips hidden or empty startup surfaces', () => {
|
||||
assert.equal(
|
||||
shouldPrimeLinuxOverlayInteractionFromMeasurement({
|
||||
getVisibleOverlayVisible: () => true,
|
||||
getMainWindow: () => ({
|
||||
isDestroyed: () => false,
|
||||
isVisible: () => false,
|
||||
getBounds: () => BOUNDS,
|
||||
}),
|
||||
getSubtitleMeasurement: () => MEASUREMENT,
|
||||
shouldSuspend: () => false,
|
||||
}),
|
||||
false,
|
||||
);
|
||||
assert.equal(
|
||||
shouldPrimeLinuxOverlayInteractionFromMeasurement({
|
||||
getVisibleOverlayVisible: () => true,
|
||||
getMainWindow: () => ({
|
||||
isDestroyed: () => false,
|
||||
isVisible: () => true,
|
||||
getBounds: () => BOUNDS,
|
||||
}),
|
||||
getSubtitleMeasurement: () => ({
|
||||
viewport: MEASUREMENT.viewport,
|
||||
contentRect: null,
|
||||
interactiveRects: [],
|
||||
}),
|
||||
shouldSuspend: () => false,
|
||||
}),
|
||||
false,
|
||||
);
|
||||
});
|
||||
|
||||
test('mapOverlayMeasurementForPointerInteraction preserves renderer interactive rects', () => {
|
||||
const mapped = mapOverlayMeasurementForPointerInteraction({
|
||||
layer: 'visible',
|
||||
|
||||
Reference in New Issue
Block a user