Closed easoncxz closed 3 years ago
Looking good. List of Lists is arriving in the UI.
The next step is to dig more information out about each List:
API summary:
GET lists/members
: see who's in the listGET lists/statuses
: see the timeline of this listImplementation tasks:
Related reading:
createIndex
: https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/createIndexQuestion:
keyPath
, not sure what to pass as keyPath
to createIndex
.Some progress:
Looking very good -- I got some kind of manual-JOIN working in idb. As such, I was able to load from idb:
I got confused a lot by the question of what should be the keyPath
for the index. This is the crucial diff:
diff --git a/frontend-app/src/dom/twitter/storage.ts b/frontend-app/src/dom/twitter/storage.ts
index e262fb2..cd2ce8c 100644
--- a/frontend-app/src/dom/twitter/storage.ts
+++ b/frontend-app/src/dom/twitter/storage.ts
@@ -67,7 +67,7 @@ export async function openMyDB(): Promise<IDBPDatabase<TwitDb>> {
autoIncrement: true,
});
// TODO: what to use as index keyPath?
- listMemberships.createIndex('by-list', [], {
+ listMemberships.createIndex('by-list', 'listIdStr', {
unique: false,
});
}
Over the course of debugging it, I came across another crucial question and answer -- how to do composite keys in IndexedDB object-stores? See this StackOverflow post:
Update: In fact, I later came across more errors, and found a StackOverflow that points out precisely my problem -- []
is not valid as a keyPath
:
createIndex
https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/createIndexAdded new journal about IndexedDB index concerns:
For showing the tweets of a given user in the middle-pane in this UI, we're finally facing the problem of dealing with timelines. See Twitter docs:
I have an incredibly ugly UI that demonstrates the ability to "focus" on a user:
The thing toggles, and stuff works.
Pretty steady progress here:
As of commits 40cd7af and 6aa146c, there is a rather useful amount of functionality now: any member-user of any list can now be added to or removed from any list.
It's starting to be useful enough that screenshots would show more than I prefer them to! Closing this issue now.
The idea is to quickly add accounts to other lists.
Reference material
GET lists/list