Skip to content

Commit d5a70d1

Browse files
committed
Merge branch 'dev' into main
2 parents 1e73b06 + 53798af commit d5a70d1

File tree

11 files changed

+73
-26
lines changed

11 files changed

+73
-26
lines changed

.circleci/config.yml

+6
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,12 @@ jobs:
186186
- run:
187187
name: Build iOS app
188188
command: pnpm run build:ios
189+
- run:
190+
name: Create review demo metadata files
191+
command: |
192+
cd apps/client/src-capacitor/ios/App/fastlane/metadata/review_information
193+
echo $FASTLANE_REVIEW_DEMO_USER > demo_user.txt
194+
echo $FASTLANE_REVIEW_DEMO_PASSWORD > demo_password.txt
189195
- run:
190196
name: Install Ruby bundle
191197
command: |

apps/client/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@deepnotes/client",
33
"description": "DeepNotes",
44
"homepage": "https://deepnotes.app",
5-
"version": "1.0.19",
5+
"version": "1.0.20",
66
"author": "Gustavo Toyota <[email protected]>",
77
"dependencies": {
88
"@_ueberdosis/prosemirror-tables": "~1.1.3",

apps/client/src-capacitor/ios/App/App.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@
359359
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.productivity";
360360
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
361361
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
362-
MARKETING_VERSION = 1.0.19;
362+
MARKETING_VERSION = 1.0.20;
363363
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
364364
PRODUCT_BUNDLE_IDENTIFIER = app.deepnotes;
365365
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -386,7 +386,7 @@
386386
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.productivity";
387387
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
388388
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
389-
MARKETING_VERSION = 1.0.19;
389+
MARKETING_VERSION = 1.0.20;
390390
PRODUCT_BUNDLE_IDENTIFIER = app.deepnotes;
391391
PRODUCT_NAME = "$(TARGET_NAME)";
392392
PROVISIONING_PROFILE_SPECIFIER = "";

apps/client/src/code/pages/page/elems/find-and-replace.ts

+20
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ export class PageFindAndReplace {
115115
editor.commands.setFindTerm('');
116116
}
117117
}
118+
119+
this.react.resultCount = 0;
118120
}
119121
}
120122

@@ -137,6 +139,22 @@ export class PageFindAndReplace {
137139
return;
138140
}
139141

142+
let parent = elemInfo.elem.react.region;
143+
144+
while (parent?.type === 'note') {
145+
if (parent.react.collapsing.collapsed) {
146+
parent.react.collapsing.collapsed = false;
147+
}
148+
149+
parent = parent.react.region;
150+
}
151+
152+
if (elemInfo.elem?.type === 'note' && this.editorIndex > 0) {
153+
if (elemInfo.elem.react.collapsing.collapsed) {
154+
elemInfo.elem.react.collapsing.collapsed = false;
155+
}
156+
}
157+
140158
const editor = elemInfo.editors[this.editorIndex];
141159

142160
if (editor == null) {
@@ -272,6 +290,8 @@ export class PageFindAndReplace {
272290
}
273291
}
274292
}
293+
294+
this.updateResultCount();
275295
}
276296
}
277297

apps/client/src/code/pages/page/page.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,12 @@ export class Page implements IPageRegion {
358358

359359
// Bump on recent pages
360360

361-
pull(this.app.react.recentPageIds, this.id);
362-
this.app.react.recentPageIds.unshift(this.id);
361+
internals.pages.recentPageIdsKeepOverride = true;
362+
internals.pages.react.recentPageIdsOverride = [
363+
...internals.pages.react.recentPageIds,
364+
];
365+
pull(this.app.react.recentPageIdsOverride!, this.id);
366+
this.app.react.recentPageIdsOverride!.unshift(this.id);
363367

364368
// Bump on server
365369

apps/client/src/code/pages/pages.ts

+26-15
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ import type { Serialization } from './serialization';
1414

1515
export interface IAppReact {
1616
pathPageIds: string[];
17-
recentPageIds: string[];
17+
18+
recentPageIdsOverride?: string[];
19+
recentPageIds: ComputedRef<string[]>;
1820

1921
page: ShallowRef<Page>;
2022
pageId: ComputedRef<string | undefined>;
@@ -42,6 +44,8 @@ export class Pages {
4244

4345
parentPageId?: string;
4446

47+
recentPageIdsKeepOverride?: boolean;
48+
4549
constructor(input: { factories: Factories }) {
4650
this.factories = input.factories;
4751

@@ -50,7 +54,21 @@ export class Pages {
5054

5155
this.react = reactive({
5256
pathPageIds: [],
53-
recentPageIds: [],
57+
recentPageIds: computed(() => {
58+
if (this.recentPageIdsKeepOverride) {
59+
this.recentPageIdsKeepOverride = undefined;
60+
} else {
61+
this.react.recentPageIdsOverride = undefined;
62+
}
63+
64+
const recentPageIds = internals.realtime.globalCtx.hget(
65+
'user',
66+
authStore().userId,
67+
'recent-page-ids',
68+
);
69+
70+
return this.react.recentPageIdsOverride ?? recentPageIds ?? [];
71+
}),
5472

5573
page: shallowRef(null) as any,
5674
pageId: computed(() => this.react.page?.id),
@@ -82,17 +100,12 @@ export class Pages {
82100

83101
promises.push(
84102
(async () => {
85-
const [
86-
encryptedDefaultNote,
87-
encryptedDefaultArrow,
88-
recentPageIdsJSON,
89-
isNewUser,
90-
] = await internals.realtime.hmget('user', authStore().userId, [
91-
'encrypted-default-note',
92-
'encrypted-default-arrow',
93-
'recent-page-ids',
94-
'new',
95-
]);
103+
const [encryptedDefaultNote, encryptedDefaultArrow, isNewUser] =
104+
await internals.realtime.hmget('user', authStore().userId, [
105+
'encrypted-default-note',
106+
'encrypted-default-arrow',
107+
'new',
108+
]);
96109

97110
this.defaultNote = unpack(
98111
internals.symmetricKeyring.decrypt(encryptedDefaultNote, {
@@ -113,8 +126,6 @@ export class Pages {
113126
}),
114127
);
115128

116-
this.react.recentPageIds = recentPageIdsJSON ?? [];
117-
118129
this.react.isNewUser = !!isNewUser;
119130

120131
if (isNewUser) {

apps/client/src/components/Checklist.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PassthroughComponent
44
:is="itemsWrapper"
55
v-bind="wrapperProps"
6-
v-on="wrapperEvents"
6+
v-on="wrapperEvents ?? {}"
77
>
88
<slot
99
v-if="itemIds.length === 0"

apps/client/src/layouts/PagesLayout/LeftSidebar/RecentPages.vue

+5-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ async function removeRecentPage(pageId: string) {
8383
try {
8484
await trpcClient.users.pages.removeRecentPage.mutate({ pageId });
8585
86-
pull(internals.pages.react.recentPageIds, pageId);
86+
internals.pages.recentPageIdsKeepOverride = true;
87+
internals.pages.react.recentPageIdsOverride = [
88+
...internals.pages.react.recentPageIds,
89+
];
90+
pull(internals.pages.react.recentPageIdsOverride, pageId);
8791
} catch (error) {
8892
handleError(error);
8993
}

apps/client/src/layouts/PagesLayout/RightSidebar/NoteProperties/NewPageDialog.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ const groupOptions = computed(() => [
172172
}
173173
174174
if (
175+
groupId !== page.value.react.groupId &&
175176
!rolesMap()[groupMemberRoles.value[groupIndex]]?.permissions
176177
.editGroupPages
177178
) {
@@ -204,6 +205,7 @@ const groupMemberName = ref('');
204205
onMounted(async () => {
205206
// Initialize group IDs
206207
208+
destGroupId.value = page.value.react.groupId;
207209
groupIds.value = [page.value.react.groupId];
208210
209211
// Focus page title
@@ -241,8 +243,6 @@ onMounted(async () => {
241243
).text;
242244
})(),
243245
]);
244-
245-
destGroupId.value = page.value.react.groupId;
246246
});
247247
248248
async function _createPage() {

apps/client/src/layouts/PagesLayout/RightSidebar/PageProperties/MovePageDialog.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ const groupOptions = computed(() => [
160160
}
161161
162162
if (
163+
groupId !== internals.pages.react.page.react.groupId &&
163164
!rolesMap()[groupMemberRoles.value[groupIndex]]?.permissions
164165
.editGroupPages
165166
) {
@@ -176,6 +177,7 @@ const groupOptions = computed(() => [
176177
]);
177178
178179
onMounted(async () => {
180+
destGroupId.value = props.groupId;
179181
groupIds.value = [props.groupId];
180182
181183
await Promise.all([
@@ -201,8 +203,6 @@ onMounted(async () => {
201203
groupMemberName.value = await selfUserName().getAsync();
202204
})(),
203205
]);
204-
205-
destGroupId.value = props.groupId;
206206
});
207207
208208
async function _movePage() {

packages/@deeplib/data/src/data-hashes/user/recent-page-ids.ts

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import type { UserModel } from '@deeplib/db';
22
import type { DataField } from '@stdlib/data';
33

44
export const recentPageIds: DataField<UserModel> = {
5+
notifyUpdates: true,
6+
57
userGettable: ({ userId, suffix }) => userId === suffix,
68

79
columns: ['recent_page_ids'],

0 commit comments

Comments
 (0)