tangled
alpha
login
or
join now
me.webbeef.org
/
browser.html
18
fork
atom
Rewild Your Web
web
browser
dweb
18
fork
atom
overview
issues
1
pulls
pipelines
system: improve edge gestures management
webbeef.tngl.sh
3 weeks ago
c2b39b69
ea9878ad
+78
-3
5 changed files
expand all
collapse all
unified
split
ui
system
edge_gesture_handler.js
mobile.css
mobile_action_bar.js
mobile_layout_manager.js
mobile_notification_sheet.js
+15
ui/system/edge_gesture_handler.js
···
332
332
this.peekPreview.style.transform = "";
333
333
}
334
334
}
335
335
+
336
336
+
// Enable or disable specific edge overlays
337
337
+
// edges: object with left, right, bottom, top boolean properties
338
338
+
setEdgesEnabled(edges) {
339
339
+
for (const [edge, enabled] of Object.entries(edges)) {
340
340
+
const overlay = this.edgeOverlays[edge];
341
341
+
if (overlay) {
342
342
+
if (edge === "left" || edge === "right") {
343
343
+
overlay.style.width = enabled ? `${this.edgeThreshold}px` : "0";
344
344
+
} else {
345
345
+
overlay.style.height = enabled ? `${this.edgeThreshold}px` : "0";
346
346
+
}
347
347
+
}
348
348
+
}
349
349
+
}
335
350
}
+1
-1
ui/system/mobile.css
···
296
296
touch-action: none;
297
297
pointer-events: auto;
298
298
background: transparent;
299
299
-
/* rgba(77, 215, 220, 0.49); */
299
299
+
/* background: rgba(77, 215, 220, 0.49); */
300
300
}
301
301
302
302
/* Expand edge overlay to full screen during active gesture,
+6
-1
ui/system/mobile_action_bar.js
···
56
56
show() {
57
57
this.updateState();
58
58
this.open = true;
59
59
+
this.dispatchEvent(
60
60
+
new CustomEvent("action-bar-opened", { bubbles: true, composed: true }),
61
61
+
);
59
62
}
60
63
61
64
hide() {
···
63
66
this.results = [];
64
67
this.groups = [];
65
68
this.searchController.clear();
69
69
+
this.dispatchEvent(
70
70
+
new CustomEvent("action-bar-closed", { bubbles: true, composed: true }),
71
71
+
);
66
72
}
67
73
68
74
toggle() {
···
167
173
if (this.layoutManager) {
168
174
this.layoutManager.reload();
169
175
}
170
170
-
this.hide();
171
176
}
172
177
173
178
handleViews() {
+42
ui/system/mobile_layout_manager.js
···
47
47
this.actionBar.updateState();
48
48
}
49
49
});
50
50
+
51
51
+
// Disable all edges when action bar or notification sheet opens
52
52
+
document.addEventListener("action-bar-opened", () => {
53
53
+
this.disableAllEdges();
54
54
+
});
55
55
+
document.addEventListener("action-bar-closed", () => {
56
56
+
this.restoreEdges();
57
57
+
});
58
58
+
document.addEventListener("sheet-opened", () => {
59
59
+
this.disableAllEdges();
60
60
+
});
61
61
+
document.addEventListener("sheet-closed", () => {
62
62
+
this.restoreEdges();
63
63
+
});
64
64
+
}
65
65
+
66
66
+
// Disable all edge gestures (when overlay UI is open)
67
67
+
disableAllEdges() {
68
68
+
this.gestureHandler.setEdgesEnabled({
69
69
+
left: false,
70
70
+
right: false,
71
71
+
bottom: false,
72
72
+
top: false,
73
73
+
});
74
74
+
}
75
75
+
76
76
+
// Restore edge gestures based on current state
77
77
+
restoreEdges() {
78
78
+
const onHomescreen = this.isHomescreen(this.activeWebviewId);
79
79
+
this.gestureHandler.setEdgesEnabled({
80
80
+
left: !onHomescreen,
81
81
+
right: !onHomescreen,
82
82
+
bottom: !onHomescreen,
83
83
+
top: true,
84
84
+
});
50
85
}
51
86
52
87
generateId() {
···
56
91
// Set the homescreen webview
57
92
setHomescreen(webviewId) {
58
93
this.homescreenWebviewId = webviewId;
94
94
+
// Update edge gestures if homescreen is currently active
95
95
+
if (this.activeWebviewId === webviewId) {
96
96
+
this.restoreEdges();
97
97
+
}
59
98
}
60
99
61
100
// Check if a webview is the homescreen
···
178
217
container.classList.add("active");
179
218
}
180
219
}
220
220
+
221
221
+
// Update edge gesture areas based on whether we're on the homescreen
222
222
+
this.restoreEdges();
181
223
}
182
224
183
225
// Switch to webview at given index
+14
-1
ui/system/mobile_notification_sheet.js
···
57
57
58
58
close() {
59
59
this.open = false;
60
60
-
this.dispatchEvent(new CustomEvent("sheet-closed", { bubbles: true }));
60
60
+
}
61
61
+
62
62
+
updated(changedProperties) {
63
63
+
if (changedProperties.has("open")) {
64
64
+
if (this.open) {
65
65
+
this.dispatchEvent(
66
66
+
new CustomEvent("sheet-opened", { bubbles: true, composed: true }),
67
67
+
);
68
68
+
} else {
69
69
+
this.dispatchEvent(
70
70
+
new CustomEvent("sheet-closed", { bubbles: true, composed: true }),
71
71
+
);
72
72
+
}
73
73
+
}
61
74
}
62
75
63
76
handleNotificationClick(notification) {