fix(quotes): keep same-thread board previews local

This commit is contained in:
Tommaso Casaburi
2026-04-16 15:33:12 +07:00
parent f6ce2ba018
commit e366dac25c
16 changed files with 293 additions and 64 deletions
@@ -4,7 +4,7 @@ import useCreateBoardModalStore from '../use-create-board-modal-store';
import useDirectoryModalStore from '../use-directory-modal-store';
import useDisclaimerModalStore, { DISCLAIMER_ACCEPTED_KEY } from '../use-disclaimer-modal-store';
import useFeedResetStore from '../use-feed-reset-store';
import usePostNumberStore from '../use-post-number-store';
import usePostNumberStore, { getCidForPostNumber, getScopedNumberToCidMap } from '../use-post-number-store';
import useReplyModalStore from '../use-reply-modal-store';
import useSelectedTextStore from '../use-selected-text-store';
import useSortingStore from '../use-sorting-store';
@@ -235,6 +235,26 @@ describe('interaction stores', () => {
expect(usePostNumberStore.getState().numberToCid).toBe(numberToCidRef);
});
it('merges alias-scoped post number maps when the exact board scope is only partially populated', () => {
const numberToCid = {
'music.eth': {
1: 'op-cid',
2: 'reply-cid',
},
'music.bso': {
30: 'late-reply-cid',
},
};
expect(getScopedNumberToCidMap(numberToCid, 'music.bso')).toEqual({
1: 'op-cid',
2: 'reply-cid',
30: 'late-reply-cid',
});
expect(getCidForPostNumber(numberToCid, 'music.bso', 1)).toBe('op-cid');
expect(getCidForPostNumber(numberToCid, 'music.bso', 30)).toBe('late-reply-cid');
});
it('opens reply modals with quoted selection and mobile scroll state', () => {
Object.defineProperty(window, 'innerWidth', {
configurable: true,