Skip to content

Commit 6208f82

Browse files
authored
Merge pull request #1425 from session-foundation/feat/ses-2601/session_network
Added Session Network page
2 parents 0d3091e + 88838f1 commit 6208f82

File tree

168 files changed

+7663
-961
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+7663
-961
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Remember, you can preview this before saving it.
2424
Describe briefly what your pull request changes. Focus on the value provided to users.
2525
2626
Does it address any outstanding issues in this project?
27-
https://github.com/loki-project/loki-messenger/issues?utf8=%E2%9C%93&q=is%3Aissue
27+
https://github.com/session-foundation/session-desktop/issues?q=sort%3Aupdated-desc+is%3Aissue+is%3Aopen
2828
Reference an issue with the hash symbol: "#222"
2929
If you're fixing it, use something like "Fixes #222"
3030

_locales/en/messages.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,7 @@
836836
"sessionInviteAFriend": "Invite a Friend",
837837
"sessionMessageRequests": "Message Requests",
838838
"sessionNetworkCurrentPrice": "Current SESH price",
839+
"sessionNetworkDataPrice": "Price data powered by CoinGecko<br/>Accurate at {datetime}",
839840
"sessionNetworkDescription": "Messages are sent using the Session Network. The network is comprised of nodes incentivized with Session Token, which keeps Session decentralized and secure. <span><b>Learn More</b> {icon}</span>",
840841
"sessionNetworkLearnAboutStaking": "Learn About Staking",
841842
"sessionNetworkMarketCap": "Market Cap",

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@
118118
"semver": "^7.7.1",
119119
"styled-components": "^6.1.15",
120120
"uuid": "11.1.0",
121+
"viem": "^2.26.0",
121122
"webrtc-adapter": "^4.2.2",
122123
"zod": "^3.24.2"
123124
},

preload.js

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,20 @@ window.getUserKeys = async () => {
5454
};
5555

5656
window.sessionFeatureFlags = {
57-
useOnionRequests: true,
58-
useTestNet: isTestNet() || isTestIntegration(),
59-
useClosedGroupV2QAButtons: false, // TODO DO NOT MERGE Remove after QA
6057
replaceLocalizedStringsWithKeys: false,
58+
showSettingsOnStart: false,
59+
// Hooks
60+
useClosedGroupV2QAButtons: false, // TODO DO NOT MERGE Remove after QA
61+
useOnionRequests: true,
6162
useReleaseChannels: true,
63+
useSESH101: true,
64+
useTestNet: isTestNet() || isTestIntegration(),
6265
debug: {
6366
debugLogging: !isEmpty(process.env.SESSION_DEBUG),
6467
debugLibsessionDumps: !isEmpty(process.env.SESSION_DEBUG_LIBSESSION_DUMPS),
6568
debugBuiltSnodeRequests: !isEmpty(process.env.SESSION_DEBUG_BUILT_SNODE_REQUEST),
6669
debugSwarmPolling: !isEmpty(process.env.SESSION_DEBUG_SWARM_POLLING),
67-
debugFileServerRequests: false,
70+
debugServerRequests: false,
6871
debugNonSnodeRequests: false,
6972
debugOnionRequests: false,
7073
},
@@ -283,15 +286,17 @@ setInterval(() => {
283286

284287
window.clipboard = clipboard;
285288

286-
window.getSeedNodeList = () =>
287-
window.sessionFeatureFlags.useTestNet
288-
? ['http://seed2.getsession.org:38157']
289-
: [
290-
// Note: for each of the seed nodes, the cert pinned is the one provided on the port 4443 and not the 4433, because the 4443 is a 10year one
291-
'https://seed1.getsession.org:4443/',
292-
'https://seed2.getsession.org:4443/',
293-
'https://seed3.getsession.org:4443/',
294-
];
289+
window.getSeedNodeList = () => {
290+
if (window.sessionFeatureFlags.useTestNet) {
291+
return ['http://seed2.getsession.org:38157'];
292+
}
293+
return [
294+
// Note: for each of the seed nodes, the cert pinned is the one provided on the port 4443 and not the 4433, because the 4443 is a 10year one
295+
'https://seed1.getsession.org:4443/',
296+
'https://seed2.getsession.org:4443/',
297+
'https://seed3.getsession.org:4443/',
298+
];
299+
};
295300

296301
window.addEventListener('contextmenu', e => {
297302
const editable = e && e.target.closest('textarea, input, [contenteditable="true"]');

third_party_licenses/LucideLicense.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of
44

55
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
66

7-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
7+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

tools/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ files by running the following script:
6666
definitions [locales.ts](../ts/localization/locales.ts). This script also validates the dynamic variables in each
6767
locale file and flags any errors.
6868

69-
The generated type file is not committed to the repository and is generated at build time. It is generated here to ensure
70-
that changes to any type definitions are not problematic.
69+
The generated type file is not committed to the repository and is generated at build time. It is generated here to ensure that changes to any type definitions are not problematic.
7170

7271
## [Generate Localized Strings Analysis](./localization/generateLocalizedStringsAnalysis.sh)
7372

ts/components/AboutView.tsx

Lines changed: 85 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import { useEffect } from 'react';
22
import styled from 'styled-components';
3+
import { Provider } from 'react-redux';
4+
import { shell } from 'electron';
35
import { SessionTheme } from '../themes/SessionTheme';
46
import { switchThemeTo } from '../themes/switchTheme';
57
import { SessionToastContainer } from './SessionToastContainer';
68
import { Flex } from './basic/Flex';
7-
import { SessionButtonType } from './basic/SessionButton';
8-
import { CopyToClipboardButton } from './buttons/CopyToClipboardButton';
9+
import { themeStore } from '../state/theme/store';
10+
import { SessionButton, SessionButtonType } from './basic/SessionButton';
11+
import { Localizer } from './basic/Localizer';
12+
import { CopyToClipboardButton } from './buttons';
13+
import { localize } from '../localization/localeTools';
914

1015
const StyledContent = styled(Flex)`
1116
background-color: var(--background-primary-color);
@@ -36,8 +41,9 @@ const StyledContent = styled(Flex)`
3641
font-size: var(--font-size-sm);
3742
font-weight: 400;
3843
min-height: var(--font-size-sm);
44+
height: var(--font-size-sm);
3945
font-size: var(--font-size-sm);
40-
margin-bottom: var(--margins-xs);
46+
margin-bottom: var(--margins-sm);
4147
}
4248
`;
4349

@@ -53,13 +59,18 @@ export const AboutView = () => {
5359
environmentStates.push(window.getAppInstance());
5460
}
5561

56-
const versionInfo = `v${window.getVersion()}`;
57-
const systemInfo = window.i18n('systemInformationDesktop', {
58-
information: window.getOSRelease(),
59-
});
60-
const commitInfo = window.i18n('commitHashDesktop', {
61-
hash: window.getCommitHash() || window.i18n('unknown'),
62-
});
62+
const version = window.getVersion();
63+
const versionInfo = localize('updateVersion').withArgs({ version }).toString();
64+
const systemInfo = localize('systemInformationDesktop')
65+
.withArgs({
66+
information: window.getOSRelease(),
67+
})
68+
.toString();
69+
const commitInfo = localize('commitHashDesktop')
70+
.withArgs({
71+
hash: window.getCommitHash() || localize('unknown').toString(),
72+
})
73+
.toString();
6374

6475
useEffect(() => {
6576
if (window.theme) {
@@ -71,58 +82,72 @@ export const AboutView = () => {
7182
}, []);
7283

7384
return (
74-
<SessionTheme>
75-
<SessionToastContainer />
76-
<StyledContent
77-
$container={true}
78-
$flexDirection={'column'}
79-
$justifyContent={'center'}
80-
$alignItems={'center'}
81-
>
82-
<img
83-
src="images/session/session_icon.png"
84-
alt="session brand icon"
85-
width="200"
86-
height="200"
87-
/>
88-
<img
89-
src="images/session/session-text.svg"
90-
alt="session brand text"
91-
width={192}
92-
height={26}
93-
/>
94-
<CopyToClipboardButton
95-
className="version"
96-
text={versionInfo}
97-
buttonType={SessionButtonType.Simple}
98-
/>
99-
<CopyToClipboardButton
100-
className="os"
101-
text={systemInfo}
102-
buttonType={SessionButtonType.Simple}
103-
/>
104-
<CopyToClipboardButton
105-
className="commitHash"
106-
text={commitInfo}
107-
buttonType={SessionButtonType.Simple}
108-
/>
109-
{environmentStates.length ? (
85+
<Provider store={themeStore}>
86+
<SessionTheme>
87+
<SessionToastContainer />
88+
<StyledContent
89+
$container={true}
90+
$flexDirection={'column'}
91+
$justifyContent={'center'}
92+
$alignItems={'center'}
93+
>
94+
<img
95+
src="images/session/session_icon.png"
96+
alt="session brand icon"
97+
width="200"
98+
height="200"
99+
/>
100+
<img
101+
src="images/session/session-text.svg"
102+
alt="session brand text"
103+
width={192}
104+
height={26}
105+
/>
106+
<CopyToClipboardButton
107+
className="version"
108+
text={versionInfo}
109+
buttonType={SessionButtonType.Simple}
110+
/>
111+
<SessionButton
112+
buttonType={SessionButtonType.Simple}
113+
margin="0 0 var(--margins-lg) 0"
114+
style={{ textDecoration: 'underline' }}
115+
onClick={() => {
116+
void shell.openExternal(
117+
`https://github.com/session-foundation/session-desktop/releases/tag/v${version}`
118+
);
119+
}}
120+
>
121+
<Localizer token="updateReleaseNotes" />
122+
</SessionButton>
123+
<CopyToClipboardButton
124+
className="os"
125+
text={systemInfo}
126+
buttonType={SessionButtonType.Simple}
127+
/>
110128
<CopyToClipboardButton
111-
className="environment"
112-
text={environmentStates.join(' - ')}
129+
className="commitHash"
130+
text={commitInfo}
113131
buttonType={SessionButtonType.Simple}
114132
/>
115-
) : null}
116-
<a href="https://getsession.org">https://getsession.org</a>
117-
<br />
118-
<a className="privacy" href="https://getsession.org/privacy-policy">
119-
{window.i18n('onboardingPrivacy')}
120-
</a>
121-
<a className="privacy" href="https://getsession.org/terms-of-service/">
122-
{window.i18n('onboardingTos')}
123-
</a>
124-
<br />
125-
</StyledContent>
126-
</SessionTheme>
133+
{environmentStates.length ? (
134+
<CopyToClipboardButton
135+
className="environment"
136+
text={environmentStates.join(' - ')}
137+
buttonType={SessionButtonType.Simple}
138+
/>
139+
) : null}
140+
<a href="https://getsession.org" style={{ margin: '0 0 var(--margins-lg) 0' }}>
141+
https://getsession.org
142+
</a>
143+
<a className="privacy" href="https://getsession.org/privacy-policy">
144+
<Localizer token="onboardingPrivacy" />
145+
</a>
146+
<a className="privacy" href="https://getsession.org/terms-of-service/">
147+
<Localizer token="onboardingTos" />
148+
</a>
149+
</StyledContent>
150+
</SessionTheme>
151+
</Provider>
127152
);
128153
};

ts/components/EmptyMessageView.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { useSelector } from 'react-redux';
22
import styled from 'styled-components';
33
import { getLeftPaneConversationIdsCount } from '../state/selectors/conversations';
4-
import { useIsDarkTheme } from '../state/selectors/theme';
54
import { isSignWithRecoveryPhrase } from '../util/storage';
65
import { Flex } from './basic/Flex';
76
import { Spacer2XL, SpacerXS } from './basic/Text';
@@ -69,7 +68,6 @@ const StyledNoConversations = styled(StyledP)`
6968
`;
7069

7170
export const EmptyMessageView = () => {
72-
const isDarkTheme = useIsDarkTheme();
7371
const conversationCount = useSelector(getLeftPaneConversationIdsCount);
7472
const isSignInWithRecoveryPhrase = isSignWithRecoveryPhrase();
7573

@@ -90,9 +88,7 @@ export const EmptyMessageView = () => {
9088
<StyledPartyPopper src="images/party-popper.svg" alt="party popper emoji" />
9189
<Spacer2XL />
9290
<StyledHeading>{window.i18n('onboardingAccountCreated')}</StyledHeading>
93-
<StyledSessionWelcome
94-
color={isDarkTheme ? 'var(--primary-color)' : 'var(--text-primary-color)'}
95-
>
91+
<StyledSessionWelcome color={'var(--renderer-span-primary-color)'}>
9692
<Localizer token="onboardingBubbleWelcomeToSession" args={{ emoji: '👋' }} />
9793
</StyledSessionWelcome>
9894
</>

ts/components/MemberListItem.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import styled from 'styled-components';
22

33
import { GroupPubkeyType, MemberStateGroupV2, PubkeyType } from 'libsession_util_nodejs';
44
import { isEmpty } from 'lodash';
5+
import type { SessionDataTestId } from 'react';
56
import {
67
useNicknameOrProfileNameOrShortenedPubkey,
78
useWeAreAdmin,
@@ -114,7 +115,7 @@ type MemberListItemProps<T extends string> = {
114115
isAdmin?: boolean; // if true, we add a small crown on top of their avatar
115116
onSelect?: (pubkey: T) => void;
116117
onUnselect?: (pubkey: T) => void;
117-
dataTestId?: React.SessionDataTestId;
118+
dataTestId?: SessionDataTestId;
118119
displayGroupStatus?: boolean;
119120
groupPk?: string;
120121
disabled?: boolean;
@@ -139,9 +140,9 @@ const ResendContainer = ({
139140
return (
140141
<Flex
141142
$container={true}
143+
$flexGap="var(--margins-sm)"
142144
margin="0 0 0 auto"
143145
padding="0 var(--margins-lg)"
144-
gap="var(--margins-sm)"
145146
>
146147
<ResendButton groupPk={groupPk} pubkey={pubkey} />
147148
<PromoteButton groupPk={groupPk} pubkey={pubkey} />

ts/components/SessionInboxView.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ import {
2020
} from '../state/ducks/conversations';
2121
import { initialDefaultRoomState } from '../state/ducks/defaultRooms';
2222
import { initialModalState } from '../state/ducks/modalDialog';
23-
import { initialOnionPathState } from '../state/ducks/onion';
23+
import { initialOnionPathState } from '../state/ducks/onions';
2424
import { initialPrimaryColorState } from '../state/ducks/primaryColor';
2525
import { initialSearchState } from '../state/ducks/search';
2626
import { initialSectionState } from '../state/ducks/section';
2727
import { getEmptyStagedAttachmentsState } from '../state/ducks/stagedAttachments';
28-
import { initialThemeState } from '../state/ducks/theme';
2928
import { initialUserConfigState } from '../state/ducks/userConfig';
3029
import { StateType } from '../state/reducer';
3130
import { SessionMainPanel } from './SessionMainPanel';
@@ -44,6 +43,9 @@ import { Flex } from './basic/Flex';
4443
import { initialReleasedFeaturesState } from '../state/ducks/releasedFeatures';
4544
import { initialDebugState } from '../state/ducks/debug';
4645
import type { UserGroupState } from '../state/ducks/userGroups';
46+
import { initialThemeState } from '../state/theme/ducks/theme';
47+
import { initialNetworkModalState } from '../state/ducks/networkModal';
48+
import { initialNetworkDataState } from '../state/ducks/networkData';
4749

4850
function makeLookup<T>(items: Array<T>, key: string): { [key: string]: T } {
4951
// Yep, we can't index into item without knowing what it is. True. But we want to.
@@ -94,6 +96,8 @@ async function createSessionInboxStore() {
9496
userGroups: { userGroups },
9597
releasedFeatures: initialReleasedFeaturesState,
9698
debug: initialDebugState,
99+
networkModal: initialNetworkModalState,
100+
networkData: initialNetworkDataState,
97101
};
98102

99103
return createStore(initialState);

0 commit comments

Comments
 (0)