Conversation
|
Updates to Preview Branch (eng-1650-temporary-username-in-obsidian) ↗︎
Tasks are run on every commit but only new migration files are pushed.
View logs for this Workflow Run ↗︎. |
369e231 to
e59af43
Compare
aacac24 to
31ff57c
Compare
…ence means local author.
22021e7 to
f1e4a06
Compare
| nodesBySpace.get(node.spaceId)!.push(node); | ||
| } | ||
|
|
||
| await fetchUserNames(plugin, client); |
There was a problem hiding this comment.
🟡 Author names display as 'user {id}' in ImportNodesModal selection step because fetchUserNames is called too late
fetchUserNames is only called inside importSelectedNodes (apps/obsidian/src/utils/importNodes.ts:1245), which runs when the user clicks the final "Import" button. However, getUserNameById is called during the renderSelectStep() in ImportNodesModal.tsx (lines 343 and 367) to display author names before the import happens. At that point, plugin.settings.userNames has not been populated by fetchUserNames, so every author name renders as the fallback user {id} string from apps/obsidian/src/utils/typeUtils.ts:96. The fix is to call fetchUserNames during loadImportableNodes (alongside the existing getSpaceNameFromIds/getSpaceUris calls) so the names are available when the selection UI first renders.
Prompt for agents
The fetchUserNames call on line 1245 of importNodes.ts only runs during importSelectedNodes (the final import step). But getUserNameById is used in ImportNodesModal.tsx renderSelectStep to show author names during the node selection UI, before import happens. At that point plugin.settings.userNames is empty so all names show as 'user {id}'.
To fix this, call fetchUserNames during loadImportableNodes in ImportNodesModal.tsx (around where getSpaceNameFromIds and getSpaceUris are called, circa line 80-97 of ImportNodesModal.tsx). You can also keep the call in importSelectedNodes for the case where importSelectedNodes is called from a different code path. The key thing is ensuring userNames is populated before renderSelectStep renders the author names.
Was this helpful? React with 👍 or 👎 to provide feedback.
Add the username field, propagate it to the PlatformAccount, expose it in the frontmatter, Discourse Context and import modal.
https://www.loom.com/share/9981c436ba894ca0b55482a61b2b382f
After changes:
https://www.loom.com/share/a0be92baadf04615acaafc7f79d7870e