feat(post-menu): add Report/Delete, reorder buttons, edit-only-for-mods, copy link 5chan.app (#1089)

* Update crypto address UI for .bso accounts

* feat(post-menu): add Report/Delete, reorder buttons, edit-only-for-mods, copy link 5chan.app

- Remove redundant reason field from edit menu (purged posts unreachable)
- Add Report post (placeholder alert) and Delete post (mobile) to post menus
- Reorder: Report, Hide, Delete, Copy x3, Image search
- Mobile edit checkbox only for mods; authors use Delete in post menu
- Copy direct link always uses 5chan.app domain
- 10px margin-top on mod menu save button

* fix(post-menu): add confirmation before delete post (Bugbot)
This commit is contained in:
Tommaso Casaburi
2026-03-16 17:54:17 +08:00
committed by GitHub
parent 6ecf3c40d3
commit f4ff7a23f7
43 changed files with 299 additions and 84 deletions
@@ -29,7 +29,10 @@ vi.mock('react-i18next', () => ({
}),
}));
vi.mock('@bitsocialnet/bitsocial-react-hooks', () => ({}));
vi.mock('@bitsocialnet/bitsocial-react-hooks', () => ({
useAccount: () => ({ author: { address: '0xmod' }, signer: { address: '0xauthor' } }),
usePublishCommentEdit: () => ({ publishCommentEdit: vi.fn().mockResolvedValue(undefined) }),
}));
vi.mock('@bitsocialnet/bitsocial-react-hooks/dist/lib/localforage-lru/index.js', () => ({
default: {
@@ -172,10 +175,10 @@ describe('PostMenuMobile', () => {
container.remove();
});
it('opens the mobile menu, copies share metadata, and shows edit controls for privileged users', async () => {
it('opens the mobile menu, copies share metadata, and shows edit controls for mods', async () => {
testState.privileges = {
isAccountCommentAuthor: true,
isAccountMod: false,
isAccountMod: true,
};
await renderMenu('/mu');
@@ -203,12 +206,16 @@ describe('PostMenuMobile', () => {
expect(testState.hideMock).toHaveBeenCalled();
});
it('shows edit controls on pseudonymous boards even without a local author-address match', async () => {
it('does not show edit controls on pseudonymous boards when user is not a mod', async () => {
testState.pseudonymityMode = 'per-post';
testState.privileges = {
isAccountCommentAuthor: false,
isAccountMod: false,
};
await renderMenu('/mu');
expect(document.body.querySelector('[data-testid="edit-menu"]')?.textContent).toBe('cid-1');
expect(document.body.querySelector('[data-testid="edit-menu"]')).toBeNull();
});
it("does not show edit controls when pseudonymity mode is 'none' and the user lacks privileges", async () => {