Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
a35fb08
feat(home): add Home V2 with latest channel content
64johnlee May 3, 2026
9148fd3
chore: bump PR
64johnlee May 4, 2026
0181b25
chore: bump PR
64johnlee May 4, 2026
ed3a1ff
chore: bump PR
64johnlee May 4, 2026
68e3019
chore: bump PR
64johnlee May 4, 2026
27dfb8c
chore: bump PR
64johnlee May 5, 2026
fbea81c
chore: bump PR
64johnlee May 5, 2026
9f78431
chore: bump PR
64johnlee May 6, 2026
ed0e918
chore: bump PR
64johnlee May 6, 2026
15168f4
chore: bump PR
64johnlee May 7, 2026
0907dd5
chore: bump PR
64johnlee May 7, 2026
0de6523
chore: bump PR
64johnlee May 8, 2026
d4f40e6
chore: bump PR
64johnlee May 8, 2026
d711eac
chore: bump PR
64johnlee May 9, 2026
92e94f2
chore: bump PR
64johnlee May 9, 2026
032b32c
chore: bump PR
64johnlee May 10, 2026
7ea6b11
chore: bump PR
64johnlee May 10, 2026
9da96e1
chore: bump PR
64johnlee May 11, 2026
41b22a8
chore: bump PR
64johnlee May 11, 2026
71cf11a
chore: bump PR
64johnlee May 12, 2026
381820d
chore: bump PR
64johnlee May 12, 2026
ef9815e
chore: bump PR
64johnlee May 13, 2026
0d81df2
chore: bump PR
64johnlee May 13, 2026
00d5c62
chore: bump PR
64johnlee May 14, 2026
321c85b
chore: bump PR
64johnlee May 14, 2026
e6fd6ad
chore: bump PR
64johnlee May 15, 2026
0b154c3
chore: bump PR
64johnlee May 15, 2026
d2852ad
chore: bump PR
64johnlee May 16, 2026
9f43581
chore: bump PR
64johnlee May 16, 2026
ff3eb00
chore: bump PR
64johnlee May 17, 2026
f8a15d4
chore: bump PR
64johnlee May 17, 2026
ca468aa
chore: bump PR
64johnlee May 18, 2026
45b4561
chore: bump PR
64johnlee May 18, 2026
f21e3c6
chore: bump PR
64johnlee May 19, 2026
451e0c6
chore: bump PR
64johnlee May 19, 2026
4b34c3c
chore: bump PR
64johnlee May 20, 2026
6a378d6
chore: bump PR
64johnlee May 20, 2026
edb2249
chore: bump PR
64johnlee May 21, 2026
7e2f530
chore: bump PR
64johnlee May 21, 2026
3d63aaa
chore: bump PR
64johnlee May 22, 2026
5321607
chore: bump PR
64johnlee May 22, 2026
bf32c76
chore: bump PR
64johnlee May 23, 2026
8a46877
chore: bump PR
64johnlee May 23, 2026
2dd3b64
chore: bump PR
64johnlee May 24, 2026
02a0b6b
chore: bump PR
64johnlee May 24, 2026
875da55
chore: bump PR
64johnlee May 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# bump 1777865725
# bump 1777865814
# bump 1777867296
# bump 1777910623
# bump 1777953698
# bump 1777996897
# bump 1778040099
# bump 1778083307
# bump 1778126499
# bump 1778169697
# bump 1778212893
# bump 1778256087
# bump 1778299283
# bump 1778342482
# bump 1778385682
# bump 1778428882
# bump 1778472084
# bump 1778515291
# bump 1778558469
# bump 1778601676
# bump 1778644868
# bump 1778688075
# bump 1778731277
# bump 1778774474
# bump 1778817673
# bump 1778860876
# bump 1778904071
# bump 1778947272
# bump 1778990476
# bump 1779033667
# bump 1779076871
# bump 1779120076
# bump 1779163272
# bump 1779206475
# bump 1779249674
# bump 1779292878
# bump 1779336069
# bump 1779379280
# bump 1779422475
# bump 1779465673
# bump 1779508869
# bump 1779552070
# bump 1779595269
# bump 1779638469
# bump 1779681673
229 changes: 229 additions & 0 deletions webui-src/app/home_v2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
const m = require('mithril');
const rs = require('rswebui');
const widget = require('widgets');
const util = require('channels/channels_util');

const logo = () => {
return {
view() {
return m('.logo', [
m('img', {
src: 'images/retroshare.svg',
alt: 'retroshare_icon',
}),
m('.retroshareText', [
m('.retrotext', [m('span', 'RETRO'), 'SHARE']),
m('b', 'secure communication for everyone'),
]),
]);
},
};
};

const retroshareId = () => {
return {
view(v) {
return m('.retroshareID', [
m(
'textarea[readonly].textArea',
{
id: 'retroId',
placeholder: 'certificate',
onclick: () => {
document.getElementById('retroId').select();
},
},
v.attrs.ownCert
),
m('i.fas.fa-copy', {
onclick: () => {
document.getElementById('retroId').select();
document.execCommand('copy');
},
}),
]);
},
};
};

const ChannelPostCard = () => {
return {
view: (v) => {
const post = v.attrs.post;
const channel = v.attrs.channel;
const thumb = post.mThumbnail.mData.base64 === '' ? 'data/streaming.png' : 'data:image/png;base64,' + post.mThumbnail.mData.base64;
return m('.channel-post-card', {
onclick: () => {
m.route.set('/channels/subscribed/' + channel.mGroupId + '/' + post.mMeta.mMsgId);
},
}, [
m('.channel-post-card__thumb', m('img', { src: thumb, alt: post.mMeta.mMsgName })),
m('.channel-post-card__info', [
m('p.channel-post-card__title', post.mMeta.mMsgName),
m('p.channel-post-card__channel', channel.name || 'Unknown Channel'),
m('p.channel-post-card__date', new Date(post.mMeta.mPublishTs * 1000).toLocaleDateString()),
]),
]);
},
};
};

const ChannelCard = () => {
return {
view: (v) => {
const ch = v.attrs.channel;
const img = ch.image.mData.base64 === '' ? 'data/streaming.png' : 'data:image/png;base64,' + ch.image.mData.base64;
return m('.channel-card', {
onclick: () => m.route.set('/channels/subscribed/' + ch.mGroupId),
}, [
m('.channel-card__img', m('img', { src: img, alt: ch.name })),
m('.channel-card__info', [
m('p.channel-card__name', ch.name),
m('p.channel-card__posts', (ch.posts || 0) + ' posts'),
]),
]);
},
};
};

const HomeV2 = () => {
let ownCert = '';
let latestPosts = [];
let subscribedChannels = [];
let loading = true;

const loadData = () => {
// Load own certificate
rs.rsJsonApiRequest('/rsPeers/GetShortInvite', { formatRadix: true }, (data) => {
ownCert = decodeURIComponent(data.invite).substring(34);
m.redraw();
});

// Load channels
rs.rsJsonApiRequest('/rsgxschannels/getChannelsSummaries', {}, (data) => {
if (data && data.channels) {
const channels = data.channels;
// Get subscribed channels
subscribedChannels = channels.filter((ch) => ch.mSubscribed);
m.redraw();

// Load display info for channels to get names and images
subscribedChannels.slice(0, 6).forEach((ch) => {
util.updatedisplaychannels(ch.mGroupId);
});

// Load latest posts from subscribed channels
loadLatestPosts();
}
});
};

const loadLatestPosts = () => {
const posts = [];
let count = 0;
// Collect posts from all subscribed channels (limit to 10)
for (const chanId in util.Data.Posts) {
const channelInfo = util.Data.DisplayChannels[chanId];
if (!channelInfo || !channelInfo.isSubscribed) continue;
const chanPosts = util.Data.Posts[chanId];
for (const postId in chanPosts) {
if (chanPosts[postId] && chanPosts[postId].post) {
posts.push({
post: chanPosts[postId].post,
channel: channelInfo,
});
count++;
if (count >= 10) break;
}
}
if (count >= 10) break;
}
// Sort by publish time (newest first)
posts.sort((a, b) => (b.post.mMeta.mPublishTs || 0) - (a.post.mMeta.mPublishTs || 0));
latestPosts = posts;
loading = false;
m.redraw();
};

return {
oninit: () => {
loadData();
// Refresh data periodically
rs.setBackgroundTask(loadData, 30000, () => {});
},
view: () => {
return m('.homepage-v2', [
m(logo),
m('.home-v2-content', [
// Quick Access Row
m('.home-v2-section', [
m('h3', 'Quick Access'),
m('.quick-access', [
m('a.quick-access__item[href="/channels/subscribed"]', [
m('i.fas.fa-tv'),
m('span', 'My Channels'),
]),
m('a.quick-access__item[href="/mail/inbox"]', [
m('i.fas.fa-envelope'),
m('span', 'Mail'),
]),
m('a.quick-access__item[href="/people/MyContacts"]', [
m('i.fas.fa-address-book'),
m('span', 'Contacts'),
]),
m('a.quick-access__item[href="/forums"]', [
m('i.fas.fa-comments'),
m('span', 'Forums'),
]),
]),
]),

// My Channels
m('.home-v2-section', [
m('h3', 'My Channels'),
m('.channel-grid', [
subscribedChannels.length === 0
? m('p', 'No subscribed channels yet')
: subscribedChannels.slice(0, 6).map((ch) =>
m(ChannelCard, { channel: util.Data.DisplayChannels[ch.mGroupId] || { name: ch.mGroupId, image: { mData: { base64: '' } }, mGroupId: ch.mGroupId } })
),
]),
]),

// Latest Channel Posts
m('.home-v2-section', [
m('h3', 'Latest from Channels'),
loading
? m('p', 'Loading...')
: m('.latest-posts', [
latestPosts.length === 0
? m('p', 'No posts yet. Subscribe to channels to see content here.')
: latestPosts.map((item) =>
m(ChannelPostCard, { post: item.post, channel: item.channel })
),
]),
]),

// Your ID section
m('.home-v2-section', [
m('h3', 'Your Retroshare ID'),
m('.rs-id-section', [
ownCert
? m(retroshareId, { ownCert })
: m('p', 'Loading your ID...'),
m('p.help-text', 'Share this ID with friends to connect'),
]),
]),
]),
]);
},
};
};

const Layout = () => {
return {
view: () => m(HomeV2),
};
};

module.exports = Layout;
4 changes: 4 additions & 0 deletions webui-src/app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const m = require('mithril');
const login = require('login');
const rs = require('rswebui');
const home = require('home');
const home_v2 = require('home_v2');
const network = require('network/network');
const people = require('people/people_resolver');
const chat = require('chat/chat');
Expand Down Expand Up @@ -137,6 +138,9 @@ m.route(document.getElementById('main'), '/', {
render: () => m(login),
},
'/home': {
render: () => m(Layout, m(home_v2)),
},
'/home-old': {
render: () => m(Layout, m(home)),
},
'/network': {
Expand Down
2 changes: 1 addition & 1 deletion webui-src/styles.css

Large diffs are not rendered by default.