@@ -95,6 +95,7 @@ const contactsStorePath = resolve(process.cwd(), "src/storage/contacts-store.ts"
9595const messagesStorePath = resolve ( process . cwd ( ) , "src/storage/messages-store.ts" ) ;
9696const readStateStorePath = resolve ( process . cwd ( ) , "src/storage/read-state-store.ts" ) ;
9797const receiptPolicyStorePath = resolve ( process . cwd ( ) , "src/storage/receipt-policy-store.ts" ) ;
98+ const lastOpenedChatStorePath = resolve ( process . cwd ( ) , "src/storage/last-opened-chat-store.ts" ) ;
9899const receiptPolicySlicePath = resolve ( process . cwd ( ) , "src/state/slices/receipt-policy-slice.ts" ) ;
99100const conversationsBootstrapPath = resolve ( process . cwd ( ) , "src/storage/use-conversations-bootstrap.ts" ) ;
100101const contactsSlicePath = resolve ( process . cwd ( ) , "src/state/slices/contacts-slice.ts" ) ;
@@ -786,6 +787,9 @@ void test("PWA chat log follows the reader only when they are already at the lat
786787 assert . match ( messageLog , / s e t S h o w S c r o l l T o B o t t o m \( ! a t B o t t o m \) / ) ;
787788 assert . match ( messageLog , / S c r o l l t o b o t t o m / ) ;
788789 assert . match ( messageLog , / V e r t i c a l A l i g n B o t t o m O u t l i n e d / ) ;
790+ assert . match ( messageLog , / i s - v i s i b l e / ) ;
791+ assert . match ( messageLog , / a r i a - h i d d e n = \{ ! s h o w S c r o l l T o B o t t o m \} / ) ;
792+ assert . match ( messageLog , / t a b I n d e x = \{ s h o w S c r o l l T o B o t t o m \? 0 : - 1 \} / ) ;
789793 assert . match ( messageLog , / C h a t D a y D i v i d e r / ) ;
790794 assert . match ( messageLog , / D e l i v e r y S t a t e I c o n / ) ;
791795 assert . match ( messageLog , / L o a d i n g O u t l i n e d s p i n / ) ;
@@ -1210,6 +1214,8 @@ void test("contacts, messages, read state, and inbound requests persist through
12101214 const readStateSlice = await readFile ( readStateSlicePath , "utf8" ) ;
12111215 const hydrationSlice = await readFile ( hydrationSlicePath , "utf8" ) ;
12121216 const requireIdentity = await readFile ( requireIdentityPath , "utf8" ) ;
1217+ const lastOpenedChatStore = await readFile ( lastOpenedChatStorePath , "utf8" ) ;
1218+ const app = await readFile ( appPath , "utf8" ) ;
12131219
12141220 assert . match ( database , / c o n s t D A T A B A S E _ V E R S I O N = 5 / ) ;
12151221 assert . match ( database , / I D E N T I T Y _ S T O R E / ) ;
@@ -1228,12 +1234,23 @@ void test("contacts, messages, read state, and inbound requests persist through
12281234 assert . match ( bootstrap , / l o a d S t o r e d R e a d S t a t e / ) ;
12291235 assert . match ( bootstrap , / a w a i t r e m o v e L e g a c y D e m o S t a t e \( \) / ) ;
12301236 assert . match ( bootstrap , / l o a d S t o r e d M e s s a g e R e q u e s t s / ) ;
1237+ assert . match ( bootstrap , / l o a d S t o r e d L a s t O p e n e d C h a t / ) ;
1238+ assert . match ( bootstrap , / c o n t a c t s \. s o m e \( \( c o n t a c t \) = > c o n t a c t \. c o n t a c t I d = = = l a s t O p e n e d C h a t I d \) / ) ;
1239+ assert . match ( bootstrap , / c l e a r S t o r e d L a s t O p e n e d C h a t / ) ;
12311240 assert . match ( bootstrap , / s e t C o n v e r s a t i o n s L o a d e d / ) ;
1241+ assert . match ( lastOpenedChatStore , / R E C E I P T _ P O L I C Y _ S T O R E / ) ;
1242+ assert . match ( lastOpenedChatStore , / l o a d S t o r e d L a s t O p e n e d C h a t / ) ;
1243+ assert . match ( lastOpenedChatStore , / s a v e S t o r e d L a s t O p e n e d C h a t / ) ;
1244+ assert . match ( lastOpenedChatStore , / c l e a r S t o r e d L a s t O p e n e d C h a t / ) ;
1245+ assert . match ( app , / L a s t O p e n e d C h a t O r E m p t y P a n e / ) ;
1246+ assert . match ( app , / c h a t P a t h \( s e l e c t e d C o n t a c t \. c o n t a c t I d \) / ) ;
12321247 assert . match ( contactsSlice , / s a v e S t o r e d C o n t a c t / ) ;
12331248 assert . match ( contactsSlice , / d e l e t e S t o r e d C o n t a c t / ) ;
12341249 assert . match ( contactsSlice , / f o r g e t C o n t a c t / ) ;
12351250 assert . match ( contactsSlice , / d e l e t e S t o r e d M e s s a g e s F o r C o n t a c t / ) ;
12361251 assert . match ( contactsSlice , / d e l e t e S t o r e d R e a d S t a t e / ) ;
1252+ assert . match ( contactsSlice , / s a v e S t o r e d L a s t O p e n e d C h a t / ) ;
1253+ assert . match ( contactsSlice , / c l e a r S t o r e d L a s t O p e n e d C h a t / ) ;
12371254 assert . match ( messagesStore , / i n d e x \( " b y C o n t a c t I d " \) \. o p e n C u r s o r \( I D B K e y R a n g e \. o n l y \( c o n t a c t I d \) \) / ) ;
12381255 assert . match ( readStateStore , / d e l e t e S t o r e d R e a d S t a t e / ) ;
12391256 assert . match ( await readFile ( receiptPolicyStorePath , "utf8" ) , / o p e n D a t a b a s e / ) ;
0 commit comments