mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-12-02 08:03:40 +08:00
Setup incorrectly said Google cannot search places fixed. buttons duplicated shared CSS. A few minor touch-ups.
This commit is contained in:
@@ -148,8 +148,8 @@
|
||||
/* Setup choices: compact M3 choice buttons with an expandable info popover. */
|
||||
.gx-choice { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: var(--sp-2); }
|
||||
.gx-choice__head { display: flex; align-items: center; gap: var(--sp-2); }
|
||||
.gx-choice__legend { padding: 0; font-weight: var(--fw-medium); float: left; }
|
||||
.gx-choice__info-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; min-height: 32px !important; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted); font-size: .95rem; cursor: pointer; transition: background var(--motion-fast), color var(--motion-fast); }
|
||||
.gx-choice__legend { font-weight: var(--fw-medium); }
|
||||
.gx-choice__info-btn { color: var(--text-muted); font-size: .95rem; }
|
||||
.gx-choice__info-btn:hover, .gx-choice__info-btn[aria-expanded="true"] { background: var(--surface-container-high); color: var(--primary); }
|
||||
.gx-choice__hint { margin: 0; color: var(--text-muted); font-size: .85rem; }
|
||||
.gx-choice__grid { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
|
||||
@@ -166,7 +166,7 @@
|
||||
.gx-choice__active-summary { margin: 0; color: var(--text-muted); font-size: .83rem; line-height: 1.4; }
|
||||
.gx-choice__popover { display: grid; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--outline); border-radius: var(--radius-md); background: var(--surface-container-high, var(--surface-container)); font-size: .85rem; }
|
||||
.gx-choice__popover-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
|
||||
.gx-choice__popover-close { display: inline-grid; place-items: center; width: 28px; height: 28px; min-height: 28px !important; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted); cursor: pointer; }
|
||||
.gx-choice__popover-close { color: var(--text-muted); }
|
||||
.gx-choice__popover-close:hover { background: var(--glass-active-bg); color: var(--on-surface); }
|
||||
.gx-choice__popover-list { margin: 0; display: grid; gap: var(--sp-2); }
|
||||
.gx-choice__popover-item { display: grid; gap: 2px; padding-top: var(--sp-2); border-top: 1px solid var(--outline); }
|
||||
|
||||
@@ -15,10 +15,10 @@ export const ChoiceGroup = {
|
||||
},
|
||||
},
|
||||
template: `
|
||||
<fieldset class="gx-choice" :disabled="disabled">
|
||||
<fieldset class="gx-choice" :disabled="disabled" :aria-label="label">
|
||||
<div class="gx-choice__head">
|
||||
<legend class="gx-choice__legend">{{ label }}</legend>
|
||||
<button type="button" class="gx-choice__info-btn" :aria-expanded="infoOpen" :aria-label="'More info about ' + label"
|
||||
<strong class="gx-choice__legend">{{ label }}</strong>
|
||||
<button type="button" class="gx-icon-btn gx-choice__info-btn" :aria-expanded="infoOpen" :aria-label="'More info about ' + label"
|
||||
:title="'More info about ' + label" @click="infoOpen = !infoOpen">
|
||||
<i class="bi" :class="infoOpen ? 'bi-info-circle-fill' : 'bi-info-circle'" aria-hidden="true"></i>
|
||||
</button>
|
||||
@@ -40,7 +40,7 @@ export const ChoiceGroup = {
|
||||
<div v-if="infoOpen" class="gx-choice__popover" role="region" :aria-label="label + ' details'">
|
||||
<div class="gx-choice__popover-head">
|
||||
<strong>{{ label }} options</strong>
|
||||
<button type="button" class="gx-choice__popover-close" aria-label="Close details" @click="infoOpen = false">
|
||||
<button type="button" class="gx-icon-btn gx-choice__popover-close" aria-label="Close details" @click="infoOpen = false">
|
||||
<i class="bi bi-x-lg" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
@@ -54,9 +54,9 @@ export const ChoiceGroup = {
|
||||
</fieldset>`,
|
||||
}
|
||||
|
||||
// What each service does and where it stops. Mapbox always does search and offline roads.
|
||||
// Provider capabilities and limits.
|
||||
export const COMPARE_ROWS = [
|
||||
["Place search and addresses", "Yes", "No, Mapbox does this"],
|
||||
["Place search and addresses", "Yes", "Yes, when Google gives directions; Mapbox is the fallback"],
|
||||
["Offline road maps", "Yes", "No, Google tiles can't be saved"],
|
||||
["Lane arrows on the turn card", "Yes", "No"],
|
||||
["Traffic in route times", "Yes", "Yes, with a correction every 7½ minutes"],
|
||||
|
||||
@@ -73,7 +73,8 @@ def simplify(points, limit: int = PREVIEW_POINTS, tolerance: float = PREVIEW_TOL
|
||||
if length < 1e-9:
|
||||
deviation = np.hypot(*(inner - a).T)
|
||||
else:
|
||||
deviation = np.abs(direction[0] * (inner[:, 1] - a[1]) - direction[1] * (inner[:, 0] - a[0])) / length
|
||||
fraction = np.clip((inner - a) @ direction / length ** 2, 0., 1.)
|
||||
deviation = np.hypot(*(inner - (a + fraction[:, None] * direction)).T)
|
||||
index = int(np.argmax(deviation))
|
||||
if deviation[index] <= tolerance:
|
||||
continue
|
||||
|
||||
@@ -544,6 +544,11 @@ def test_route_line_keeps_corners_and_thins_straight_road():
|
||||
assert len(simplify(wiggle)) == PREVIEW_POINTS
|
||||
|
||||
|
||||
def test_route_line_preserves_a_collinear_turnaround():
|
||||
from openpilot.starpilot.navigation.route_engine import simplify
|
||||
assert simplify([(0., 0.), (.01, 0.), (.005, 0.)]) == [0, 1, 2]
|
||||
|
||||
|
||||
def garage_runtime(tmp_path, monkeypatch):
|
||||
monkeypatch.setattr(NavigationOwner, '_is_metric', lambda self: True)
|
||||
owner = NavigationOwner(tmp_path, runtime_source=lambda: None)
|
||||
|
||||
Reference in New Issue
Block a user