From 3dc87a04ee47f939351a9743aec9811c0d9680e8 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Thu, 11 Jan 2024 11:28:58 -0500 Subject: [PATCH 1/2] Bookmark groups added to top of list --- .../src/components/Services/Bookmarks/Bookmarks.bs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/playlet-lib/src/components/Services/Bookmarks/Bookmarks.bs b/playlet-lib/src/components/Services/Bookmarks/Bookmarks.bs index 012f6828..5bf6a33c 100644 --- a/playlet-lib/src/components/Services/Bookmarks/Bookmarks.bs +++ b/playlet-lib/src/components/Services/Bookmarks/Bookmarks.bs @@ -29,12 +29,15 @@ function Load() as void return end if - for each bookmarkGroup in bookmarks.groups + groupCount = bookmarks.groups.Count() + ' GetOrCreateBookmarkGroup inserts at the beginning of the list, so we need to iterate backwards + for i = groupCount - 1 to 0 step -1 + bookmarkGroup = bookmarks.groups[i] bookmarkGroupNode = GetOrCreateBookmarkGroup(bookmarkGroup.title) bookmarksCount = bookmarkGroup.bookmarks.Count() - ' AddFeedSourceBookmark inserts at the beginning of the list, so we need to iterate backwards - for i = bookmarksCount - 1 to 0 step -1 - bookmark = bookmarkGroup.bookmarks[i] + ' AddFeedSourceBookmark also inserts at the beginning of the list, so we need to iterate backwards + for j = bookmarksCount - 1 to 0 step -1 + bookmark = bookmarkGroup.bookmarks[j] AddFeedSourceBookmark(bookmark.feedSource, bookmark.id, bookmarkGroupNode) end for end for @@ -85,7 +88,7 @@ function GetOrCreateBookmarkGroup(groupName as string) as object node = CreateObject("roSGNode", "ContentNode") node.id = id node.title = groupName - m.top.content.appendChild(node) + m.top.content.insertChild(node, 0) LogInfo("Added bookmark group:", groupName) return node end function From 78b8f485f110ea963124508a9edb4f8847ebc679 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Thu, 11 Jan 2024 11:29:44 -0500 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d33670da..abfa2aab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Changed + +- Bookmarks are now added to the top of the list + ## [0.19.0] - 2024-01-10 ### Added