Compare commits

...

6 Commits

Author SHA1 Message Date
raucao 39dca446ac 1.25.1
CI / Lint (push) Successful in 46s
CI / Test (push) Successful in 1m10s
2026-06-30 23:12:42 +02:00
raucao 2e6827f0d0 Merge pull request 'Sort collections by createdAt' (#68) from ui/collection_sorting into master
CI / Lint (push) Successful in 33s
CI / Test (push) Successful in 56s
Reviewed-on: #68
2026-06-30 21:10:59 +00:00
raucao 8c3a805684 Sort collections by createdAt
CI / Lint (pull_request) Successful in 34s
CI / Test (pull_request) Successful in 57s
Release Drafter / Update release notes draft (pull_request) Successful in 8s
2026-06-30 23:07:53 +02:00
raucao cf80c1eea7 1.25.0
CI / Lint (push) Successful in 33s
CI / Test (push) Successful in 57s
2026-06-30 19:35:52 +02:00
raucao 126806fcd4 Merge pull request 'Fix some routing and click/nav UX issues' (#67) from bugfix/search_routing into master
CI / Lint (push) Successful in 33s
CI / Test (push) Successful in 56s
Reviewed-on: #67
2026-06-30 17:30:26 +00:00
raucao f48045c35d Fix flaky test by adding safe guard
CI / Lint (pull_request) Successful in 33s
CI / Test (pull_request) Successful in 57s
Release Drafter / Update release notes draft (pull_request) Successful in 4s
2026-06-30 19:28:01 +02:00
10 changed files with 104 additions and 12 deletions
+1
View File
@@ -1088,6 +1088,7 @@ export default class MapComponent extends Component {
const bbox = { minLat, minLon, maxLat, maxLon };
this.mapUi.updateBounds(bbox);
await this.storage.loadPlacesInBounds(bbox);
if (this.isDestroying || this.isDestroyed) return;
this.nostrData.loadPlacesInBounds(bbox);
this.loadBookmarks(this.storage.placesInView);
+11 -1
View File
@@ -4,6 +4,16 @@ import { action } from '@ember/object';
import { tracked } from '@glimmer/tracking';
import { task } from 'ember-concurrency';
function getPlaceTime(place) {
const dateVal = place.createdAt;
if (!dateVal) return 0;
if (typeof dateVal === 'number') {
return dateVal;
}
const parsed = Date.parse(dateVal);
return isNaN(parsed) ? 0 : parsed;
}
export default class ListsListController extends Controller {
@service router;
@service mapUi;
@@ -73,7 +83,7 @@ export default class ListsListController extends Controller {
}
});
return merged;
return merged.sort((a, b) => getPlaceTime(b) - getPlaceTime(a));
}
@action
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "marco",
"version": "1.24.0",
"version": "1.25.1",
"private": true,
"description": "Unhosted maps app",
"repository": {
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -39,8 +39,8 @@
<meta name="msapplication-TileColor" content="#F6E9A6">
<meta name="msapplication-TileImage" content="/icons/icon-144.png">
<script type="module" crossorigin src="/assets/main-CLZV93ov.js"></script>
<link rel="stylesheet" crossorigin href="/assets/main-COnSXoPt.css">
<script type="module" crossorigin src="/assets/main-DNM-h3Gw.js"></script>
<link rel="stylesheet" crossorigin href="/assets/main-BGF-Udec.css">
</head>
<body>
<div id="modal-portal"></div>
+81
View File
@@ -135,4 +135,85 @@ module('Acceptance | collections navigation', function (hooks) {
'Returns gracefully back to lists/to-go list view'
);
});
test('places inside a collection are sorted by createdAt descending', async function (assert) {
class SortedMockStorageService extends Service {
initialSyncDone = true;
savedPlaces = [
{
id: 'place-oldest',
title: 'Oldest Place',
geohash: 'u33dc0',
createdAt: '2023-01-01T12:00:00.000Z',
osmTags: { name: 'Oldest Place' },
},
{
id: 'place-newest',
title: 'Newest Place',
geohash: 'u33dc0',
createdAt: '2023-01-03T12:00:00.000Z',
osmTags: { name: 'Newest Place' },
},
{
id: 'place-middle',
title: 'Middle Place',
geohash: 'u33dc0',
createdAt: '2023-01-02T12:00:00.000Z',
updatedAt: '2023-01-04T12:00:00.000Z',
osmTags: { name: 'Middle Place' },
},
];
lists = [
{
id: 'to-go',
title: 'Want to go',
color: '#2e9e4f',
placeRefs: [
{ id: 'place-oldest', geohash: 'u33dc0' },
{ id: 'place-newest', geohash: 'u33dc0' },
{ id: 'place-middle', geohash: 'u33dc0' },
],
},
];
findPlaceById(id) {
return this.savedPlaces.find((p) => p.id === id) || null;
}
isPlaceSaved() {
return true;
}
loadPlacesInBounds() {
return [];
}
getPlacesInList(listId) {
if (listId === 'to-go') {
return Promise.resolve(this.savedPlaces);
}
return Promise.resolve([]);
}
rs = {
on: () => {},
};
}
this.owner.unregister('service:storage');
this.owner.register('service:storage', SortedMockStorageService);
await visit('/lists/to-go');
await waitFor('.places-list');
const placeNames = Array.from(
document.querySelectorAll('.places-list .place-name')
).map((el) => el.textContent.trim());
assert.deepEqual(
placeNames,
['Newest Place', 'Middle Place', 'Oldest Place'],
'Places are ordered by createdAt in descending order'
);
});
});