Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions apps/roam/src/components/LeftSidebarView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ import renderOverlay from "roamjs-components/util/renderOverlay";
import getBasicTreeByParentUid from "roamjs-components/queries/getBasicTreeByParentUid";
import { DISCOURSE_CONFIG_PAGE_TITLE } from "~/data/constants";
import getPageTitleByPageUid from "roamjs-components/queries/getPageTitleByPageUid";
import { migrateLeftSidebarSettings } from "~/utils/migrateLeftSidebarSettings";
import posthog from "posthog-js";
import { commands, cleanCommandName } from "~/components/LeftSidebarCommands";
import { isSmartBlockUid } from "~/utils/isSmartBlockUid";
Expand Down Expand Up @@ -730,7 +729,6 @@ const buildConfig = (snapshot?: SettingsSnapshot): LeftSidebarConfig => {
return {
uid: oldConfig.uid,
favoritesMigrated: oldConfig.favoritesMigrated,
sidebarMigrated: oldConfig.sidebarMigrated,
global: mergeGlobalSectionWithAccessor(oldConfig.global, globalValues),
globalSectionFolded: {
uid: oldConfig.globalSectionFolded.uid,
Expand All @@ -743,7 +741,6 @@ const buildConfig = (snapshot?: SettingsSnapshot): LeftSidebarConfig => {
personalValues,
),
},
allPersonalSections: oldConfig.allPersonalSections,
};
};

Expand Down Expand Up @@ -1067,7 +1064,6 @@ export const mountLeftSidebar = async ({
let root = wrapper.querySelector(`#${id}`) as HTMLDivElement;
if (!root) {
await migrateFavorites();
await migrateLeftSidebarSettings();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Legacy sidebar entries become unusable

Graphs upgrading directly from a pre-migration release keep title-encoded entries because mountLeftSidebar no longer converts them. ChildRow treats every page entry as a UID, leaving these entries blank and unable to open.

Prompt for agents
Preserve compatibility for graphs whose legacy Left Sidebar children still contain page titles. The removed call in apps/roam/src/components/LeftSidebarView.tsx previously converted global and every user's personal sidebar children before rendering and before block-prop migration could copy those values. Restore an equivalent one-time conversion path, or make the legacy and block-prop readers normalize titles to page UIDs before ChildRow receives them. Keep the fast path for already migrated UID data, and cover direct upgrades from releases predating ENG-1127, including users whose sidebar was not mounted while the old migration existed.
Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

wrapper.innerHTML = "";
root = document.createElement("div");
root.id = id;
Expand Down
36 changes: 0 additions & 36 deletions apps/roam/src/utils/getLeftSidebarSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,8 @@ export type LeftSidebarGlobalSectionConfig = {
export type LeftSidebarConfig = {
uid: string;
favoritesMigrated: BooleanSetting;
sidebarMigrated: BooleanSetting;
global: LeftSidebarGlobalSectionConfig;
globalSectionFolded: BooleanSetting;
allPersonalSections: AllUsersPersonalSections;
personal: {
uid: string;
sections: LeftSidebarPersonalSectionConfig[];
Expand Down Expand Up @@ -146,13 +144,6 @@ const getPersonalSectionSettings = (
};
};

export type AllUsersPersonalSections = {
[userUid: string]: {
uid: string;
sections: LeftSidebarPersonalSectionConfig[];
};
};

export const getLeftSidebarPersonalSectionConfig = (
leftSidebarChildren: RoamBasicNode[],
userUid?: string,
Expand Down Expand Up @@ -202,24 +193,6 @@ export const getLeftSidebarPersonalSectionConfig = (
sections,
};
};
export const getAllLeftSidebarPersonalSectionConfigs = (
leftSidebarChildren: RoamBasicNode[],
): AllUsersPersonalSections => {
const result: AllUsersPersonalSections = {};

leftSidebarChildren
.filter((node) => node.text.endsWith("/Personal-Section"))
.forEach((node) => {
const userUid = node.text.replace("/Personal-Section", "");
result[userUid] = getLeftSidebarPersonalSectionConfig(
leftSidebarChildren,
userUid,
);
});

return result;
};

export const mergeGlobalSectionWithAccessor = (
config: LeftSidebarGlobalSectionConfig,
globalValues: LeftSidebarGlobalSettings | undefined,
Expand Down Expand Up @@ -306,17 +279,10 @@ export const getLeftSidebarSettings = (
const leftSidebarChildren = leftSidebarNode?.children || [];
const global = getLeftSidebarGlobalSectionConfig(leftSidebarChildren);
const personal = getLeftSidebarPersonalSectionConfig(leftSidebarChildren);
// TODO: remove this on complete migration task [ENG-1171: Remove `migrateLeftSideBarSettings`](https://linear.app/discourse-graphs/issue/ENG-1171/remove-migrateleftsidebarsettings)
const allPersonalSections =
getAllLeftSidebarPersonalSectionConfigs(leftSidebarChildren);
const favoritesMigrated = getUidAndBooleanSetting({
tree: leftSidebarChildren,
text: "Favorites Migrated",
});
const sidebarMigrated = getUidAndBooleanSetting({
tree: leftSidebarChildren,
text: "Sidebar Migrated",
});
const currentUserUid = window.roamAlphaAPI.user.uid();
const globalSectionFolded: BooleanSetting = currentUserUid
? getUidAndBooleanSetting({
Expand All @@ -327,10 +293,8 @@ export const getLeftSidebarSettings = (
return {
uid: leftSidebarUid,
favoritesMigrated,
sidebarMigrated,
global,
globalSectionFolded,
personal,
allPersonalSections,
};
};
74 changes: 0 additions & 74 deletions apps/roam/src/utils/migrateLeftSidebarSettings.ts

This file was deleted.