Skip to content

Commit e26095a

Browse files
committed
fix(plugins): address review findings on theme artwork, composer fold and JSON settings
1 parent a50d537 commit e26095a

4 files changed

Lines changed: 10 additions & 7 deletions

File tree

‎apps/web/src/components/chat/useTimelineFollow.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ export function useTimelineFollow(input: TimelineFollowInput) {
351351
// Stops a running position restore; follow itself is re-armed below.
352352
viewportRef.current?.navigate({ releasesFollow: false });
353353
followStore.dispatch(visit, { type: "followEnd" });
354+
setReaderScrolledVisit(null);
354355
visitScroll().showScrollDebouncer.cancel();
355356
setShowScrollToBottom(false);
356357
setTimelineAnchor(releaseChatTimelineAnchor);
@@ -533,6 +534,8 @@ export function useTimelineFollow(input: TimelineFollowInput) {
533534
});
534535
if (after === before) return;
535536
if (after.mode === "following") {
537+
// Back at the end, so a later jump away doesn't fold the composer without a new scroll.
538+
setReaderScrolledVisit(null);
536539
setTimelineAnchor(releaseChatTimelineAnchor);
537540
scroll.showScrollDebouncer.cancel();
538541
setShowScrollToBottom(false);

‎apps/web/src/hooks/useEnvironmentTheme.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,15 @@ describe("environment themes", () => {
154154
});
155155
invalidateCustomThemes();
156156
try {
157-
publish(appAtomRegistry, [NIGHTFALL_THEME]);
157+
publish(appAtomRegistry, [{ ...NIGHTFALL_THEME, sidebarArtwork: true }]);
158158
expect(getThemeDefinition("nightfall")?.label).toBe("Nightfall");
159+
expect(themeAllowsSidebarArtwork("nightfall")).toBe(true);
159160
const environment = getThemeDefinition("nightfall");
160161
if (!environment) throw new Error("expected the published theme");
161162
installCustomTheme({ ...environment, label: "My Nightfall" });
162163

163164
expect(getThemeDefinition("nightfall")?.label).toBe("My Nightfall");
165+
expect(themeAllowsSidebarArtwork("nightfall")).toBe(false);
164166
} finally {
165167
vi.unstubAllGlobals();
166168
invalidateCustomThemes();

‎apps/web/src/themePalette.ts‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,11 +1349,8 @@ export function themeAllowsComposerArtwork(theme: ThemePreference): boolean {
13491349

13501350
/** Built-in themes and published ones, such as a plugin's, can allow it; custom themes can't. */
13511351
export function themeAllowsSidebarArtwork(theme: ThemePreference): boolean {
1352-
const themeId = themeIdFromPreference(theme);
1353-
const definition =
1354-
BUILT_IN_THEME_DEFINITIONS.find((candidate) => candidate.id === themeId) ??
1355-
getEnvironmentThemes().find((candidate) => candidate.id === themeId);
1356-
return definition?.sidebarArtwork === true;
1352+
const definition = getThemeDefinition(theme);
1353+
return definition?.sidebarArtwork === true && !getCustomThemes().includes(definition);
13571354
}
13581355

13591356
/** Every selection path must check single-appearance themes to keep mix and appearance tiles in sync. */

‎docs/user/plugins.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ your plugins but runs none, and turn the plugin off.
4545
## Plugin settings
4646

4747
If a plugin has settings, open them with the settings button on its row. Each setting saves as soon
48-
as you change it or leave its field, and an empty field shows the default the plugin uses. Secret
48+
as you change it or leave its field, and an empty field shows the default the plugin uses. Settings
49+
shown as JSON save together only when you select **Save**. Secret
4950
fields are stored in the environment's secret store and are never shown again after you save them;
5051
the clear button next to one removes it.
5152

0 commit comments

Comments
 (0)