{
marginBottom: 8,
background: 'rgba(245,158,11,0.06)',
border: '1.5px solid rgba(245,158,11,0.25)',
- borderRadius: 10
+ borderRadius: 5
}}
>
@@ -1591,7 +1591,7 @@ const MultipleOrders = () => {
minHeight: 240,
background: 'rgba(24,144,255,0.03)',
border: '1px dashed rgba(24,144,255,0.25)',
- borderRadius: 12,
+ borderRadius: 5,
textAlign: 'center'
}}
>
diff --git a/src/pages/nearle/orders/orders.js b/src/pages/nearle/orders/orders.js
index 4737fcb..8604849 100644
--- a/src/pages/nearle/orders/orders.js
+++ b/src/pages/nearle/orders/orders.js
@@ -1050,7 +1050,13 @@ const Orders = () => {
// readers announce the column's sort state from
// here, not from the clickable content inside.
aria-sort={sorted === 'asc' ? 'ascending' : sorted === 'desc' ? 'descending' : canSort ? 'none' : undefined}
- style={{ width: header.getSize(), minWidth: header.column.columnDef.minSize, maxWidth: header.column.columnDef.maxSize || header.getSize(), textAlign: align, position: 'relative' }}
+ style={{
+ width: header.getSize(),
+ minWidth: header.column.columnDef.minSize,
+ maxWidth: header.column.columnDef.maxSize || header.getSize(),
+ textAlign: align,
+ position: 'relative'
+ }}
>
{
{row.getVisibleCells().map((cell) => (
{flexRender(cell.column.columnDef.cell, cell.getContext())}
diff --git a/src/pages/nearle/reports/ordersDetails.js b/src/pages/nearle/reports/ordersDetails.js
index 4e7f860..dfd2c9a 100644
--- a/src/pages/nearle/reports/ordersDetails.js
+++ b/src/pages/nearle/reports/ordersDetails.js
@@ -1366,7 +1366,7 @@ export default function OrdersDetails() {
justify="between"
vAlign="center"
padding={2}
- style={{ borderRadius: 8, backgroundColor: tint(item.color), border: `1px solid ${edge(item.color)}` }}
+ style={{ borderRadius: 5, backgroundColor: tint(item.color), border: `1px solid ${edge(item.color)}` }}
>
{item.label}
diff --git a/src/pages/nearle/riders/riders.js b/src/pages/nearle/riders/riders.js
index c48d08a..bd7f7b7 100644
--- a/src/pages/nearle/riders/riders.js
+++ b/src/pages/nearle/riders/riders.js
@@ -157,7 +157,7 @@ const LogChip = ({ color, icon: Icon, label, value }) => (
gap={1.5}
vAlign="center"
padding={2}
- style={{ borderRadius: 12, background: '#fff', border: `1px solid ${edge(color)}`, minWidth: 0 }}
+ style={{ borderRadius: 5, background: '#fff', border: `1px solid ${edge(color)}`, minWidth: 0 }}
>
diff --git a/src/themes/astryx.js b/src/themes/astryx.js
index 49d4d3d..0f63858 100644
--- a/src/themes/astryx.js
+++ b/src/themes/astryx.js
@@ -53,6 +53,19 @@ export const doormileTheme = defineTheme({
code: { family: 'ui-monospace', fallbacks: 'SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace' }
},
tokens: {
+ // ---- Corner radius -------------------------------------------------
+ // Overridden at the token level so EVERY Astryx component moves at once
+ // (cards, dialogs, popovers, buttons, inputs, menus, chat surfaces).
+ // Setting it per-component would leave the ones nobody remembered to
+ // list still rounded.
+ //
+ // `--radius-full` is deliberately untouched: it drives avatars, status
+ // dots and pill chips, which are meant to be round.
+ '--radius-page': '5px',
+ '--radius-container': '5px',
+ '--radius-element': '5px',
+ '--radius-inner': '5px',
+ '--radius-chat': '5px',
'--color-accent': [BRAND_ON_LIGHT, BRAND_ON_DARK],
'--color-icon-accent': [BRAND_ON_LIGHT, BRAND_ON_DARK],
'--color-text-accent': [BRAND_ON_LIGHT, BRAND_ON_DARK],
diff --git a/src/themes/dt/tokens.js b/src/themes/dt/tokens.js
index 978fd27..b46fdd6 100644
--- a/src/themes/dt/tokens.js
+++ b/src/themes/dt/tokens.js
@@ -7,10 +7,21 @@
// support.
// ============================================================================
export const DT = {
+ // Corner radius is uniform across the console. Boxes were 10-14px, which
+ // reads soft and consumer-ish on dense operator screens; 5px is tight
+ // enough for table density while still reading as a rounded surface.
+ //
+ // These are the shared values — change them here, not per page. The Astryx
+ // components read the matching `--radius-*` tokens set in themes/astryx.js,
+ // so both have to move together.
+ //
+ // radiusPill stays fully round on purpose — it is used for things that are
+ // shaped like pills or circles (status chips, avatars, dots). Squaring those
+ // doesn't make them consistent, it makes them look broken.
radiusPill: 999,
- radiusCard: 14,
- radiusInner: 10,
- radiusField: 10,
+ radiusCard: 5,
+ radiusInner: 5,
+ radiusField: 5,
// Restrained, low-contrast elevation — corporate (Linear/Stripe), not flashy.
shadowSoft: '0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.05)',
shadowMd: '0 1px 3px rgba(15, 23, 42, 0.06)',
diff --git a/src/utils/distance.js b/src/utils/distance.js
index 9f35c2a..5207463 100644
--- a/src/utils/distance.js
+++ b/src/utils/distance.js
@@ -6,6 +6,13 @@
* @param {Object} destination - { latitude, longitude }
* @returns {Promise} - Round distance in KM
*/
+// Duration from the most recent OSRM route, in minutes, or null when the
+// Haversine fallback was used (a straight-line estimate has no honest
+// duration — better to show nothing than a made-up ETA).
+let lastRouteDurationMin = null;
+
+export const getLastRouteDurationMin = () => lastRouteDurationMin;
+
export const calculateDrivingDistance = async (origin, destination) => {
const lat1 = origin?.latitude;
const lon1 = origin?.longitude;
@@ -26,6 +33,10 @@ export const calculateDrivingDistance = async (origin, destination) => {
if (data.routes && data.routes.length > 0) {
const distanceInMeters = data.routes[0].distance;
const distanceInKm = distanceInMeters / 1000;
+ // OSRM already returns the driving duration alongside the distance;
+ // it was being discarded. Cached here so callers that want an ETA get
+ // a REAL routed figure instead of dividing km by a guessed speed.
+ lastRouteDurationMin = Number.isFinite(data.routes[0].duration) ? Math.round(data.routes[0].duration / 60) : null;
return Math.round(distanceInKm);
}
}
@@ -44,7 +55,9 @@ export const calculateDrivingDistance = async (origin, destination) => {
Math.sin(dLon / 2) * Math.sin(dLon / 2);
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
const aerialDistance = R * c;
-
+
+ // No route was fetched, so there is no honest duration to report.
+ lastRouteDurationMin = null;
return Math.round(aerialDistance * 1.3);
};