[BLOG] Milestone Actor profile theming

This commit is contained in:
Eliseu Amaro 2021-12-09 14:44:20 +00:00 committed by Diogo Peralta Cordeiro
parent 868fb0bc8b
commit 0d8aaebfb0
Signed by: diogo
GPG Key ID: 18D2D35001FBFAB0
8 changed files with 535 additions and 335 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 KiB

View File

@ -2,10 +2,79 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel><title>GNU social V3</title><link>https://gnusocial.rocks/v3/index.html</link>
<description>Development blog where we announce our progress.</description><language>en</language>
<lastBuildDate>Sun, 05 Dec 2021 22:39:56 +0000</lastBuildDate>
<pubDate>Sun, 05 Dec 2021 22:39:56 +0000</pubDate>
<lastBuildDate>Thu, 09 Dec 2021 14:59:13 +0000</lastBuildDate>
<pubDate>Thu, 09 Dec 2021 14:59:13 +0000</pubDate>
<atom:link href="https://gnusocial.rocks/v3/feed.rss" rel="self" type="application/rss+xml" />
<item><title>
Milestone: Actor colour theme plugin
</title><description><![CDATA[
<p>Actors are now able to set their own colours, through a brand new plugin: "Oomox".
Those accustomed to customising their own desktop should know where the name comes from ;)</p>
<h2>Here's how it works!</h2>
<p>The Oomox plugin main class catches the "PopulateProfileSettingsTabs" event upon visiting user panel.</p>
<pre><code>public function onPopulateProfileSettingsTabs(Request $request, array &amp;$tabs): bool
{
$tabs[] = [
'title' =&gt; 'Light theme colours',
'desc' =&gt; 'Change the theme colours.',
'controller' =&gt; C\Oomox::oomoxSettingsLight($request),
];
$tabs[] = [
'title' =&gt; 'Dark theme colours',
'desc' =&gt; 'Change the theme colours.',
'controller' =&gt; C\Oomox::oomoxSettingsDark($request),
];
return Event::next;
}
</code></pre>
<p>As made evident by the code, two new tabs are added to profile settings, light and dark theme colours.
Since the page styling follows the system theme, actors may want to style each theme differently, therefore they are treated separately.</p>
<p>The actor's defined colours are then saved in the respective entity and cached.
Finally, the colour preferences are used to render the corresponding CSS file which defines the various colour variables used:</p>
<pre><code>public function oomoxCSS(): Response
{
$user = Common::ensureLoggedIn();
$oomox_table = PluginOomox::getEntity($user);
if (is_null($oomox_table)) {
throw new ClientException(_m('No custom colours defined', 404));
}
$content = Formatting::twigRenderFile('/oomox/root_override.css.twig', ['oomox' =&gt; $oomox_table]);
return new Response($content, status: 200, headers: ['content-type' =&gt; 'text/css']);
}
</code></pre>
<p>Please note, upon rendering for the first time, page render may be blocked until the resulting file is served. Nonetheless, subsequent page renders
won't experience the issue again. That is, if the file is cached by the browser.</p>
<h2>How it looks</h2>
<p>Tabs added using the "PopulateProfileSettingsTabs" event:
<img src="assets/actor_colour_theme_plugin/settings_change_theme_colours.png" alt="User panel Oomox sections" title="" /></p>
<p>Changing the dark theme colours!
<img src="assets/actor_colour_theme_plugin/settings_change_theme_colours3.png" alt="Dark theme colours selection" title="" /></p>
<p>The result of given changes, please note it's no longer a 'dark' theme.
Given a valid colour, it's the actor's responsibility whether or not the colours make sense. So, go wild!
<img src="assets/actor_colour_theme_plugin/settings_change_theme_colours4.png" alt="The resulting colours in action!" title="" /></p>
<!-- text end -->
]]></description><link>https://gnusocial.rocks/v3/milestone-actor-colour-theme-plugin.html</link>
<guid>https://gnusocial.rocks/v3/./milestone-actor-colour-theme-plugin.html</guid>
<dc:creator>GNU social development team</dc:creator>
<pubDate>Thu, 09 Dec 2021 14:58:35 +0000</pubDate></item>
<item><title>
Milestone: ActivityPub
</title><description><![CDATA[
@ -73,7 +142,218 @@ an idea.</p>
]]></description><link>https://gnusocial.rocks/v3/milestone-activitypub.html</link>
<guid>https://gnusocial.rocks/v3/./milestone-activitypub.html</guid>
<dc:creator>GNU social development team</dc:creator>
<pubDate>Sun, 05 Dec 2021 22:29:51 +0000</pubDate></item>
<pubDate>Thu, 09 Dec 2021 14:58:31 +0000</pubDate></item>
<item><title>
Milestone: ActivityStreams 2.0 and WebFinger
</title><description><![CDATA[
<p>The primary use of GNU social is to access the <a href="https://blog.diogo.site/what-is-the-fediverse">free network</a>, be it ActivityWeb (ActivityPub) or Fediverse (OStatus).</p>
<p>Contrary to the original plan, we have merged <a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/nightly/modules/TheFreeNetwork">The Free Network Module</a>, <a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/nightly/plugins/WebFinger">WebFinger</a> and <a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/nightly/plugins/LRDD">LRDD</a> into a single component named <a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/components/FreeNetwork">FreeNetwork</a>. Likewise, ActivityPub and ActivityStreams 2.0 was kept the same plugin instead of separated.</p>
<h2>Understanding the organisation chosen</h2>
<p>The FreeNetwork component adds WebFinger (RFC7033) lookup and implements Link-based Resource Descriptor Discovery (LRDD) based on RFC6415, Web Host Metadata. It takes and produces both Extensible Resource Descriptor (XRD) and JSON (JavaSript Object Notation). Furthermore, and different from v2, every federation protocol will use the same distribution queue maintained by this component instead of holding its own.</p>
<p>We originally intended to have data modelling plugins that would extend the GS's "language". We then understood that it added more complexity than we wanted without any considerable advantage because we cannot dissociate data reception handling of the protocol itself.</p>
<h2>Situation Report</h2>
<p><a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/plugins/ActivityPub">ActivityPub</a> already translates between activity and entity and allows plugins to extend it (thus serving a similar purpose to data modelling and representation plugins).</p>
<p>GNU social v3 now supports <a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/src/Util/Formatting.php#L292">mentions</a>, which is a process that starts in the <a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/components/Posting/Posting.php#L197">Posting component</a>. The processing of local mentions naturally finds its entire handling here.</p>
<p>For remote ActivityPub mentions, <a href="(https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/plugins/ActivityPub/Entity/ActivitypubActor.php#L179">ActivityPub handles it aided by the FreeNetwork component</a>).</p>
<h2>Next steps</h2>
<p>We still have to port OStatus (and ActivityStreams 1.0) and implement the distribution by FreeNetwork, although the base work is done. Regarding ActivityPub, although some of it already works, expanding the existing plugins to supplement ActivityPub, and full validation isn't ready yet. We will most likely finish the implementation of the whole federation stack in the next week.</p>
<!-- text end -->
]]></description><link>https://gnusocial.rocks/v3/milestone-activitystreams-20-and-webfinger.html</link>
<guid>https://gnusocial.rocks/v3/./milestone-activitystreams-20-and-webfinger.html</guid>
<dc:creator>GNU social development team</dc:creator>
<pubDate>Thu, 09 Dec 2021 14:58:31 +0000</pubDate></item>
<item><title>
Milestone: Documentation and Tests Infrastructure
</title><description><![CDATA[
<p><strong><a href="https://agile.gnusocial.rocks/doku.php?id=milestones:initial_test_documentation_infrastructure">>WIKI Milestone entry</a></strong></p>
<p>GNU social now has its documentation available in
<a href="https://docs.gnusocial.rocks/">https://docs.gnusocial.rocks/</a>. It features four
different books. These are automatically generated from the <a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/docs">source</a> using <a href="https://rust-lang.github.io/mdBook/">mdBook</a>.</p>
<blockquote>
<p>Only the development book is in an elaborated state, the other books are
holding for more ready code.</p>
</blockquote>
<p>And two of them are new:</p>
<ul>
<li>The <a href="https://docs.gnusocial.rocks/developer">Developer</a> is both intended to guide third-party plugin developers and to make it easier of contributing to the code.</li>
<li>The <a href="https://docs.gnusocial.rocks/designer">Designer</a> is the most recent of the four and came from a necessity of keeping some standardization between templates and ensuring the same principles are kept in mind when designing new themes.</li>
</ul>
<p>And two of them are updates from existing documentation:</p>
<ul>
<li>The <a href="https://docs.gnusocial.rocks/user">User</a> one is adapted
from the existing GNU social documentation for users that was provided in v2.</li>
<li>The <a href="https://docs.gnusocial.rocks/administrator">Administrator</a> one is adapted
from the "Unofficial GNU social docs" by Thomask who <a href="https://notabug.org/diogo/gnu-social/issues/246">asked us to make it official</a>.</li>
</ul>
<p>Together with the documentation we've introduced a
<a href="https://agile.gnusocial.rocks/">wiki</a>. Its purpose is to walk-through decisions,
convention, terminology. It's where we document the reasoning the development team went
through before implementing more sophisticated functionalities.</p>
<p>Finally, when the documentation doesn't explain, and to ensure the whole code
is properly tested, we have the
<a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/tests">tests</a>. And the coverage is available <a href="https://coverage.gnusocial.rocks/">here</a>. At the time of writing the coverage has 98.76% code lines tested.</p>
<!-- text end -->
]]></description><link>https://gnusocial.rocks/v3/milestone-documentation-and-tests-infrastructure.html</link>
<guid>https://gnusocial.rocks/v3/./milestone-documentation-and-tests-infrastructure.html</guid>
<dc:creator>GNU social development team</dc:creator>
<pubDate>Thu, 09 Dec 2021 14:58:31 +0000</pubDate></item>
<item><title>
Milestone: Notes and Actors with languages
</title><description><![CDATA[
<p>Well, it's that, our notes now have a language attribute.</p>
<p>... All right, all right, it's not <em>just</em> it.</p>
<h2>Here's what comes with it:</h2>
<ul>
<li><a href="">Filter the streams with only the languages you know</a></li>
<li><a href="">Federate the language for a more inclusive free network</a></li>
<li><a href="">Make Tag Wrangling possible and transversal to languages</a></li>
</ul>
<h2>Here's how it looks</h2>
<p>First, the user panel section where the desired preferences are selected:
<img src="assets/notes_and_actors_with_languages/settings_language.png" alt="User panel language settings section" title="" /></p>
<p>Upon sending the previous form, the user is redirected to order their selection:
<img src="assets/notes_and_actors_with_languages/settings_language_order.png" alt="Ordering the selections made in previous page" title="" /></p>
<p>Finally, when posting the language with the highest priority is selected by default.</p>
<p>However, by accessing "Additional options", another language may be selected. The resulting
note will have the lang attribute according to it.</p>
<p>The posting widget itself:
<img src="assets/notes_and_actors_with_languages/posting_language_options.png" alt="Selecting the language of a note when posting" title="" /></p>
<h2>What does this mean?</h2>
<p>We can now show you the notes you can read, but for groups, this mean that you
can access umbrella groups and filter the feeds to see what's in your language
and even region.</p>
<p>For too long the fediverse struggled with languages, this step makes it easier
for actual internationalization of the free network.</p>
<!-- text end -->
]]></description><link>https://gnusocial.rocks/v3/milestone-notes-and-actors-with-languages.html</link>
<guid>https://gnusocial.rocks/v3/./milestone-notes-and-actors-with-languages.html</guid>
<dc:creator>GNU social development team</dc:creator>
<pubDate>Thu, 09 Dec 2021 14:58:31 +0000</pubDate></item>
<item><title>
Milestone: Port Media handling from v2
</title><description><![CDATA[
<p><strong><a href="https://agile.gnusocial.rocks/doku.php?id=milestones:attachment_media_embed_handling">>WIKI Milestone entry</a></strong></p>
<p>File Storage in GNU social is used for avatars, for notes containing
attachments, and for notes containing links (in which case is an Embed preview).
Notes can be created by local users or fetched from remote actors. Filehash is
used to reduce file duplication.</p>
<p>When a user shares a Link that uses OpenGraph tags or has an OEmbed provider,
the <a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/plugins/Embed">Embed plugin</a> generates a preview for it that may contain a thumbnail.</p>
<p>When a user shares a Link to an image, the <a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/plugins/StoreRemoteMedia">StoreRemoteMedia plugin</a> can fetch the
file and make it available as an attachment, and will generate a thumbnail.</p>
<p>When an image, video, or other file type is uploaded or retrieved, an Attachment
entity is created. When a thumbnail is requested, one is generated if an
EncoderPlugin that supports the mime type is available.</p>
<p>There are two EncoderPlugins implemented:</p>
<ul>
<li><a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/plugins/ImageEncoder">ImageEncoder</a>: Allows to compress, validate, rescale, and sanitize images using VIPS.</li>
<li><a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/plugins/VideoEncoder">VideoEncoder</a>: Allows to rescale gifs using FFMpeg.</li>
</ul>
<p>Another helpful plugin is <a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/plugins/FileQuota">FileQuota</a> which ensures a user stays under the file quota.</p>
<h2>How is the code organised?</h2>
<p>There are various entities related to attachment and thumbnail handling.
The key ones are:</p>
<ul>
<li><a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/src/Entity/Attachment.php">Attachment</a></li>
<li><a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/src/Entity/AttachmentThumbnail.php">AttachmentThumbnail</a></li>
</ul>
<p>The plugins are able to act by means of the Events system, as elaborated in the
<a href="https://docs.gnusocial.rocks/developer/storage.html">documentation</a>.</p>
<!-- text end -->
]]></description><link>https://gnusocial.rocks/v3/milestone-port-media-handling-from-v2.html</link>
<guid>https://gnusocial.rocks/v3/./milestone-port-media-handling-from-v2.html</guid>
<dc:creator>GNU social development team</dc:creator>
<pubDate>Thu, 09 Dec 2021 14:58:31 +0000</pubDate></item>
<item><title>
Milestone: Tags
</title><description><![CDATA[
@ -154,286 +434,7 @@ tag.</p>
]]></description><link>https://gnusocial.rocks/v3/milestone-tags.html</link>
<guid>https://gnusocial.rocks/v3/./milestone-tags.html</guid>
<dc:creator>GNU social development team</dc:creator>
<pubDate>Sun, 05 Dec 2021 22:21:44 +0000</pubDate></item>
<item><title>
Milestone: Notes and Actors with languages
</title><description><![CDATA[
<p>Well, it's that, our notes now have a language attribute.</p>
<p>... All right, all right, it's not <em>just</em> it.</p>
<h2>Here's what comes with it:</h2>
<ul>
<li><a href="">Filter the streams with only the languages you know</a></li>
<li><a href="">Federate the language for a more inclusive free network</a></li>
<li><a href="">Make Tag Wrangling possible an transversal to languages</a></li>
</ul>
<h2>Here's how it looks:</h2>
<h2>What does this mean?</h2>
<p>We can now show you the notes you can read, but for groups, this mean that you
can access umbrella groups and filter the feeds to see what's in your language
and even region.</p>
<p>For too long the fediverse struggled with languages, this step makes it easier
for actual internationalization of the free network.</p>
<!-- text end -->
]]></description><link>https://gnusocial.rocks/v3/milestone-notes-and-actors-with-languages.html</link>
<guid>https://gnusocial.rocks/v3/./milestone-notes-and-actors-with-languages.html</guid>
<dc:creator>GNU social development team</dc:creator>
<pubDate>Sun, 05 Dec 2021 22:19:35 +0000</pubDate></item>
<item><title>
Milestone: ActivityStreams 2.0 and WebFinger
</title><description><![CDATA[
<p>The primary use of GNU social is to access the <a href="https://blog.diogo.site/what-is-the-fediverse">free network</a>, be it ActivityWeb (ActivityPub) or Fediverse (OStatus).</p>
<p>Contrary to the original plan, we have merged <a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/nightly/modules/TheFreeNetwork">The Free Network Module</a>, <a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/nightly/plugins/WebFinger">WebFinger</a> and <a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/nightly/plugins/LRDD">LRDD</a> into a single component named <a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/components/FreeNetwork">FreeNetwork</a>. Likewise, ActivityPub and ActivityStreams 2.0 was kept the same plugin instead of separated.</p>
<h2>Understanding the organisation chosen</h2>
<p>The FreeNetwork component adds WebFinger (RFC7033) lookup and implements Link-based Resource Descriptor Discovery (LRDD) based on RFC6415, Web Host Metadata. It takes and produces both Extensible Resource Descriptor (XRD) and JSON (JavaSript Object Notation). Furthermore, and different from v2, every federation protocol will use the same distribution queue maintained by this component instead of holding its own.</p>
<p>We originally intended to have data modelling plugins that would extend the GS's "language". We then understood that it added more complexity than we wanted without any considerable advantage because we cannot dissociate data reception handling of the protocol itself.</p>
<h2>Situation Report</h2>
<p><a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/plugins/ActivityPub">ActivityPub</a> already translates between activity and entity and allows plugins to extend it (thus serving a similar purpose to data modelling and representation plugins).</p>
<p>GNU social v3 now supports <a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/src/Util/Formatting.php#L292">mentions</a>, which is a process that starts in the <a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/components/Posting/Posting.php#L197">Posting component</a>. The processing of local mentions naturally finds its entire handling here.</p>
<p>For remote ActivityPub mentions, <a href="(https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/plugins/ActivityPub/Entity/ActivitypubActor.php#L179">ActivityPub handles it aided by the FreeNetwork component</a>).</p>
<h2>Next steps</h2>
<p>We still have to port OStatus (and ActivityStreams 1.0) and implement the distribution by FreeNetwork, although the base work is done. Regarding ActivityPub, although some of it already works, expanding the existing plugins to supplement ActivityPub, and full validation isn't ready yet. We will most likely finish the implementation of the whole federation stack in the next week.</p>
<!-- text end -->
]]></description><link>https://gnusocial.rocks/v3/milestone-activitystreams-20-and-webfinger.html</link>
<guid>https://gnusocial.rocks/v3/./milestone-activitystreams-20-and-webfinger.html</guid>
<dc:creator>GNU social development team</dc:creator>
<pubDate>Wed, 03 Nov 2021 01:48:35 +0000</pubDate></item>
<item><title>
Updates: Interface and accessibility
</title><description><![CDATA[
<p>Hello everyone! Throughout the past year there has been a lot of work in creating a polished, modern looking UI.
This update has been in the works for a long time... Many considerations had to be done, and given the current state of
modern browsers (and their over-reliance in JS) many more surfaced, leading to further testing and fixes. </p>
<p>We hope you like it!</p>
<h3>The prime directive</h3>
<blockquote>
<p>Modern looking, consistent and accessible UI across all browsers.
Non-JS version as the primary focus, <strong>JS is optional</strong> and should be regarded as such.</p>
</blockquote>
<p>The Web is 95% typography, the art and technique of arranging type to make text more readable and pleasing.
To achieve this, a textual hierarchy is fundamental, text should present a clear, readable structure to the reader.
In much of the same fashion, the way we perceive Web pages relies upon the same fundamentals. As such, by focusing on the
markup, we hope to achieve an accessible, fast and polished structure by which any browser and screen reader relies upon.</p>
<h3>Features</h3>
<ul>
<li>Accessible
<ul>
<li>Easy to use keyboard only navigation</li>
<li>Feedback on focused elements</li>
<li>Keyboard shortcuts to access main regions</li>
<li>Vi-like shortcuts</li>
<li>Screen reader tested</li>
<li>Notifies the user when focusing on key elements, such as the feed, notes and actions</li>
<li>Brief description of navigation links</li>
<li>Using semantic HTML whenever possible</li>
<li>Special care given for styling solutions that could break accessibility</li>
<li>Colors and type sizes in accordance to W3C contrast guidelines</li>
<li>Chosen specifically blue-ish and grey-ish hues for faster page loading perception</li>
</ul></li>
<li>Fast, the content provided to the user really is just markup and some CSS rules
<ul>
<li>Optionally there will be some small use cases where JS makes sense (it's the only thing modern browsers understand e.e)</li>
<li>For example, cropping your avatar before uploading a new one.</li>
<li>This is the only example until now.</li>
</ul></li>
<li>Dark and light default themes available (according to your system theme)</li>
<li>Graceful degradation for unsupported HTML elements</li>
<li>Achieving modern user interface patterns without JS</li>
<li>Various layout engines tested and work as they should
<ul>
<li>Qt WebEngine (Qutebrowser, Falkon, Otter Browser, etc...)</li>
<li>WebkitGTK (Epiphany, Midori, etc...)</li>
<li>Gecko (Firefox and derivatives)</li>
<li>Goanna (Palemoon, Basilisk, etc...)</li>
<li>Internet Explorer</li>
</ul></li>
</ul>
<h3>Video</h3>
<h4>Keyboard tests</h4>
<iframe width="560" height="315" sandbox="allow-same-origin allow-scripts allow-popups" title="GNU social v3 Accessibility: Orca reading the Public feed" src="https://tube.tchncs.de/videos/embed/9a16e84c-4150-4849-ac63-019c9a3782d9" frameborder="0" allowfullscreen></iframe>
<hr>
]]></description><link>https://gnusocial.rocks/v3/updates-interface-and-accessibility.html</link>
<guid>https://gnusocial.rocks/v3/./updates-interface-and-accessibility.html</guid>
<dc:creator>GNU social development team</dc:creator>
<pubDate>Mon, 13 Sep 2021 17:32:55 +0100</pubDate></item>
<item><title>
Updates: V3 blog
</title><description><![CDATA[
<p>We initially thought that the milestones list would be enough to
announce the development progress. But it's a little too vague
and doesn't really let us express all the on going changes and efforts.</p>
<p>The <a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/commits/branch/v3">git
history</a> is clear (we believe), but it can be challenging and obscure to outsiders and non-technical people.</p>
<p>With the introduction of this blog made with
<a href="https://github.com/cfenollosa/bashblog">bashblog</a>, we hope to make all the progress more visible and easier of following :)</p>
<p>It has a <a href="https://www.gnusocial.rocks/v3/feed.rss">RSS feed</a> so, don't
forget to subscribe!</p>
<!-- text end -->
]]></description><link>https://gnusocial.rocks/v3/updates-v3-blog.html</link>
<guid>https://gnusocial.rocks/v3/./updates-v3-blog.html</guid>
<dc:creator>GNU social development team</dc:creator>
<pubDate>Mon, 16 Aug 2021 13:37:42 +0100</pubDate></item>
<item><title>
Updates: Implement StoreRemoteMedia for v3 and port Embed
</title><description><![CDATA[
<p>GNU social comes with two plugins that add relevant media functionality.
Not talking neither about ImageEncoder nor VideoEncoder this time, but rather about StoreRemoteMedia and Embed.</p>
<p><a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/plugins/StoreRemoteMedia">StoreRemoteMedia</a>
fetches remote files when they are <code>Linked</code> to in a note. I.e., when the major mime type isn't <code>text</code>. It triggers thumbnail generation.</p>
<p><a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/plugins/Embed">Embed</a>
attempts to generate a page preview from open graph and oembed. I.e., acts when the major mime type is <code>text</code>.</p>
<p>We've changed so much with GNU social v3 that, regarding SRM there was no possible port, just a complete rewrite. Both plugins became smaller and easier to understand while promoting the same functionality with more stability.</p>
<!-- text end -->
]]></description><link>https://gnusocial.rocks/v3/updates-implement-storeremotemedia-for-v3-and-port-embed.html</link>
<guid>https://gnusocial.rocks/v3/./updates-implement-storeremotemedia-for-v3-and-port-embed.html</guid>
<dc:creator>GNU social development team</dc:creator>
<pubDate>Fri, 13 Aug 2021 13:37:42 +0100</pubDate></item>
<item><title>
Updates: Improve the Attachments system
</title><description><![CDATA[
<p>With the milestone <a href="https://www.gnusocial.rocks/v3/milestone-port-media-handling-from-v2.html">Port Media system from
v2</a> we had ported the existing
attachment system. The fact is that this system wasn't good enough.</p>
<p>It's always important to start with the original code as that allows us
to review past decisions and understand all the corner cases previously
considered.</p>
<p>Sadly, what motivated us to re-design the attachment system were the
non-considered corner cases. In particular:</p>
<ul>
<li>Remove <code>title</code> from attachment, as it's part of the relation between attachment and note.</li>
<li>Remove <code>actor</code> from attachment, many actors may publish the same attachment.</li>
<li>Remove <code>is_local</code> from attachment, as it's part of the relation between attachment and note.</li>
<li>Remove <code>remote_url</code> from attachment, different urls can return the same attachment.</li>
<li>Attachment now has a reference counter </li>
<li>Add entity GSActorToAttachment</li>
<li>Add entity GSActorToRemoteURL</li>
<li>Add entity RemoteURL</li>
<li>Add entity RemoteURLToNote</li>
<li>Add entity RemoteURLToAttachment</li>
<li>AttachmentToNote now has a title attribute</li>
</ul>
<p>Key commits:</p>
<ul>
<li><a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/commit/32ad5dbd74ebb369c4b3ed688e1fb78464fabe49">32ad5dbd74 - [ENTITY] Split Attachment in various new entities</a></li>
<li><a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/commit/c381e58d3307e7dd07abeb9cf5b3998e34f5bd48">c381e58d33 - [ENTITY] Refactor RemoteURL entities to Link</a></li>
</ul>
<p>The structural changes and how it compares to v2 is detailed in our
<a href="http://agile.gnusocial.rocks/doku.php?id=attachment">wiki</a>.</p>
<p>Some relevant observations:</p>
<ul>
<li><code>Link</code> is now part of GNU social Data Representation terms. It represents
any remote URL being shared in a note.</li>
<li>There's only one fixed directory for GSFiles.</li>
</ul>
<!-- text end -->
]]></description><link>https://gnusocial.rocks/v3/updates-improve-the-attachments-system.html</link>
<guid>https://gnusocial.rocks/v3/./updates-improve-the-attachments-system.html</guid>
<dc:creator>GNU social development team</dc:creator>
<pubDate>Thu, 05 Aug 2021 13:37:42 +0100</pubDate></item>
<pubDate>Thu, 09 Dec 2021 14:58:31 +0000</pubDate></item>
<item><title>
Updates: Finish the Avatar component
</title><description><![CDATA[
@ -530,48 +531,86 @@ Updates: Finish the Avatar component
]]></description><link>https://gnusocial.rocks/v3/updates-finish-the-avatar-component.html</link>
<guid>https://gnusocial.rocks/v3/./updates-finish-the-avatar-component.html</guid>
<dc:creator>GNU social development team</dc:creator>
<pubDate>Wed, 04 Aug 2021 13:42:37 +0100</pubDate></item>
<pubDate>Thu, 09 Dec 2021 14:58:31 +0000</pubDate></item>
<item><title>
Milestone: Documentation and Tests Infrastructure
Updates: Implement StoreRemoteMedia for v3 and port Embed
</title><description><![CDATA[
<p><strong><a href="https://agile.gnusocial.rocks/doku.php?id=milestones:initial_test_documentation_infrastructure">>WIKI Milestone entry</a></strong></p>
<p>GNU social comes with two plugins that add relevant media functionality.
Not talking neither about ImageEncoder nor VideoEncoder this time, but rather about StoreRemoteMedia and Embed.</p>
<p>GNU social now has its documentation available in
<a href="https://docs.gnusocial.rocks/">https://docs.gnusocial.rocks/</a>. It features four
different books. These are automatically generated from the <a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/docs">source</a> using <a href="https://rust-lang.github.io/mdBook/">mdBook</a>.</p>
<p><a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/plugins/StoreRemoteMedia">StoreRemoteMedia</a>
fetches remote files when they are <code>Linked</code> to in a note. I.e., when the major mime type isn't <code>text</code>. It triggers thumbnail generation.</p>
<blockquote>
<p>Only the development book is in an elaborated state, the other books are
holding for more ready code.</p>
</blockquote>
<p><a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/plugins/Embed">Embed</a>
attempts to generate a page preview from open graph and oembed. I.e., acts when the major mime type is <code>text</code>.</p>
<p>And two of them are new:</p>
<p>We've changed so much with GNU social v3 that, regarding SRM there was no possible port, just a complete rewrite. Both plugins became smaller and easier to understand while promoting the same functionality with more stability.</p>
<!-- text end -->
]]></description><link>https://gnusocial.rocks/v3/updates-implement-storeremotemedia-for-v3-and-port-embed.html</link>
<guid>https://gnusocial.rocks/v3/./updates-implement-storeremotemedia-for-v3-and-port-embed.html</guid>
<dc:creator>GNU social development team</dc:creator>
<pubDate>Thu, 09 Dec 2021 14:58:31 +0000</pubDate></item>
<item><title>
Updates: Improve the Attachments system
</title><description><![CDATA[
<p>With the milestone <a href="https://www.gnusocial.rocks/v3/milestone-port-media-handling-from-v2.html">Port Media system from
v2</a> we had ported the existing
attachment system. The fact is that this system wasn't good enough.</p>
<p>It's always important to start with the original code as that allows us
to review past decisions and understand all the corner cases previously
considered.</p>
<p>Sadly, what motivated us to re-design the attachment system were the
non-considered corner cases. In particular:</p>
<ul>
<li>The <a href="https://docs.gnusocial.rocks/developer">Developer</a> is both intended to guide third-party plugin developers and to make it easier of contributing to the code.</li>
<li>The <a href="https://docs.gnusocial.rocks/designer">Designer</a> is the most recent of the four and came from a necessity of keeping some standardization between templates and ensuring the same principles are kept in mind when designing new themes.</li>
<li>Remove <code>title</code> from attachment, as it's part of the relation between attachment and note.</li>
<li>Remove <code>actor</code> from attachment, many actors may publish the same attachment.</li>
<li>Remove <code>is_local</code> from attachment, as it's part of the relation between attachment and note.</li>
<li>Remove <code>remote_url</code> from attachment, different urls can return the same attachment.</li>
<li>Attachment now has a reference counter </li>
<li>Add entity GSActorToAttachment</li>
<li>Add entity GSActorToRemoteURL</li>
<li>Add entity RemoteURL</li>
<li>Add entity RemoteURLToNote</li>
<li>Add entity RemoteURLToAttachment</li>
<li>AttachmentToNote now has a title attribute</li>
</ul>
<p>And two of them are updates from existing documentation:</p>
<p>Key commits:</p>
<ul>
<li>The <a href="https://docs.gnusocial.rocks/user">User</a> one is adapted
from the existing GNU social documentation for users that was provided in v2.</li>
<li>The <a href="https://docs.gnusocial.rocks/administrator">Administrator</a> one is adapted
from the "Unofficial GNU social docs" by Thomask who <a href="https://notabug.org/diogo/gnu-social/issues/246">asked us to make it official</a>.</li>
<li><a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/commit/32ad5dbd74ebb369c4b3ed688e1fb78464fabe49">32ad5dbd74 - [ENTITY] Split Attachment in various new entities</a></li>
<li><a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/commit/c381e58d3307e7dd07abeb9cf5b3998e34f5bd48">c381e58d33 - [ENTITY] Refactor RemoteURL entities to Link</a></li>
</ul>
<p>Together with the documentation we've introduced a
<a href="https://agile.gnusocial.rocks/">wiki</a>. Its purpose is to walk-through decisions,
convention, terminology. It's where we document the reasoning the development team went
through before implementing more sophisticated functionalities.</p>
<p>Finally, when the documentation doesn't explain, and to ensure the whole code
is properly tested, we have the
<a href="https://code.undefinedhackers.net/GNUsocial/gnu-social/src/branch/v3/tests">tests</a>. And the coverage is available <a href="https://coverage.gnusocial.rocks/">here</a>. At the time of writing the coverage has 98.76% code lines tested.</p>
<p>The structural changes and how it compares to v2 is detailed in our
<a href="http://agile.gnusocial.rocks/doku.php?id=attachment">wiki</a>.</p>
<p>Some relevant observations:</p>
<ul>
<li><code>Link</code> is now part of GNU social Data Representation terms. It represents
any remote URL being shared in a note.</li>
<li>There's only one fixed directory for GSFiles.</li>
</ul>
@ -588,8 +627,8 @@ is properly tested, we have the
<!-- text end -->
]]></description><link>https://gnusocial.rocks/v3/milestone-documentation-and-tests-infrastructure.html</link>
<guid>https://gnusocial.rocks/v3/./milestone-documentation-and-tests-infrastructure.html</guid>
]]></description><link>https://gnusocial.rocks/v3/updates-improve-the-attachments-system.html</link>
<guid>https://gnusocial.rocks/v3/./updates-improve-the-attachments-system.html</guid>
<dc:creator>GNU social development team</dc:creator>
<pubDate>Wed, 04 Aug 2021 13:37:42 +0100</pubDate></item>
<pubDate>Thu, 09 Dec 2021 14:58:31 +0000</pubDate></item>
</channel></rss>

View File

@ -45,29 +45,18 @@ Our objective is to further differentiate GNU social from the alternative softwa
<h3>Blog</h3>
<h4 class='allposts_header'>December 2021</h4>
<ul>
<li><a href="./milestone-activitypub.html">Milestone: ActivityPub</a> &mdash; December 05, 2021</li>
<li><a href="./milestone-tags.html">Milestone: Tags</a> &mdash; December 05, 2021</li>
<li><a href="./milestone-notes-and-actors-with-languages.html">Milestone: Notes and Actors with languages</a> &mdash; December 05, 2021</li>
</ul>
<h4 class='allposts_header'>November 2021</h4>
<ul>
<li><a href="./milestone-activitystreams-20-and-webfinger.html">Milestone: ActivityStreams 2.0 and WebFinger</a> &mdash; November 03, 2021</li>
</ul>
<h4 class='allposts_header'>September 2021</h4>
<ul>
<li><a href="./updates-interface-and-accessibility.html">Updates: Interface and accessibility</a> &mdash; September 13, 2021</li>
</ul>
<h4 class='allposts_header'>August 2021</h4>
<ul>
<li><a href="./updates-v3-blog.html">Updates: V3 blog</a> &mdash; August 16, 2021</li>
<li><a href="./updates-implement-storeremotemedia-for-v3-and-port-embed.html">Updates: Implement StoreRemoteMedia for v3 and port Embed</a> &mdash; August 13, 2021</li>
<li><a href="./updates-improve-the-attachments-system.html">Updates: Improve the Attachments system</a> &mdash; August 05, 2021</li>
<li><a href="./updates-finish-the-avatar-component.html">Updates: Finish the Avatar component</a> &mdash; August 04, 2021</li>
<li><a href="./milestone-documentation-and-tests-infrastructure.html">Milestone: Documentation and Tests Infrastructure</a> &mdash; August 04, 2021</li>
</ul>
<h4 class='allposts_header'>May 2021</h4>
<ul>
<li><a href="./milestone-port-media-handling-from-v2.html">Milestone: Port Media handling from v2</a> &mdash; May 03, 2021</li>
<li><a href="./milestone-actor-colour-theme-plugin.html">Milestone: Actor colour theme plugin</a> &mdash; December 09, 2021</li>
<li><a href="./milestone-activitypub.html">Milestone: ActivityPub</a> &mdash; December 09, 2021</li>
<li><a href="./milestone-activitystreams-20-and-webfinger.html">Milestone: ActivityStreams 2.0 and WebFinger</a> &mdash; December 09, 2021</li>
<li><a href="./milestone-documentation-and-tests-infrastructure.html">Milestone: Documentation and Tests Infrastructure</a> &mdash; December 09, 2021</li>
<li><a href="./milestone-notes-and-actors-with-languages.html">Milestone: Notes and Actors with languages</a> &mdash; December 09, 2021</li>
<li><a href="./milestone-port-media-handling-from-v2.html">Milestone: Port Media handling from v2</a> &mdash; December 09, 2021</li>
<li><a href="./milestone-tags.html">Milestone: Tags</a> &mdash; December 09, 2021</li>
<li><a href="./updates-finish-the-avatar-component.html">Updates: Finish the Avatar component</a> &mdash; December 09, 2021</li>
<li><a href="./updates-implement-storeremotemedia-for-v3-and-port-embed.html">Updates: Implement StoreRemoteMedia for v3 and port Embed</a> &mdash; December 09, 2021</li>
<li><a href="./updates-improve-the-attachments-system.html">Updates: Improve the Attachments system</a> &mdash; December 09, 2021</li>
<li><a href="./updates-interface-and-accessibility.html">Updates: Interface and accessibility</a> &mdash; December 09, 2021</li>
<li><a href="./updates-v3-blog.html">Updates: V3 blog</a> &mdash; December 09, 2021</li>
</ul>
<div id="all_posts"><a href="all_tags.html">All tags</a> &mdash; <a href="feed.rss">Subscribe</a></div>
</div>

View File

@ -0,0 +1,112 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=0.86, maximum-scale=5.0, minimum-scale=0.86">
<link rel="shortcut icon" href="/favicon.ico">
<link rel="stylesheet" href="https://www.gnusocial.rocks//assets/css/reset.css">
<link rel="stylesheet" href="https://www.gnusocial.rocks//assets/css/blog.css">
<link rel='stylesheet' type='text/css' href="https://www.gnusocial.rocks//assets/fonts/opensans/opensans.css"><title>Milestone: Actor colour theme plugin - GNU social V3</title>
</head><body>
<header>
<div class="home-menu menu menu-horizontal menu-fixed">
<a class="menu-heading" href="https://gnusocial.rocks/">
<img src="../assets/img/gnu-social-logo-invert.svg" alt="GNU social">
<b>gnu</b>social
</a>
</div>
<div class="sidebar">
<ul class="menu-list">
<li class="menu-item menu-selected"><a href="index.html" class="menu-link">Blog Index</a></li>
<li class="menu-item"><a href="https://code.gnusocial.rocks/" class="menu-link">Repository</a></li>
<li class="menu-item"><a href="https://coverage.gnusocial.rocks/" class="menu-link">Code Coverage</a></li>
<li class="menu-item"><a href="https://docs.gnusocial.rocks/" class="menu-link">Documentation</a></li>
<li class="menu-item"><a href="https://agile.gnusocial.rocks/" class="menu-link">Wiki</a></li>
<li class="menu-item"><a href="https://kanban.undefinedhackers.net/?controller=BoardViewController&action=readonly&token=d2293e55cabae7cceff9fb496c651328195357d392b9e61a9f229ed6d463" class="menu-link">Roadmap</a></li>
</ul>
</div>
</header>
<div class="content-wrapper">
<div class="content">
</div></div></div>
<div id="template-wrapper"><div class="template-unit">
<!-- entry begin -->
<h3><a class="ablack" href="milestone-actor-colour-theme-plugin.html">
Milestone: Actor colour theme plugin
</a></h3>
<!-- bashblog_timestamp: #202112091458.35# -->
<div class="subtitle">December 09, 2021 &mdash;
GNU social development team
</div>
<!-- text begin -->
<p>Actors are now able to set their own colours, through a brand new plugin: "Oomox".
Those accustomed to customising their own desktop should know where the name comes from ;)</p>
<h2>Here's how it works!</h2>
<p>The Oomox plugin main class catches the "PopulateProfileSettingsTabs" event upon visiting user panel.</p>
<pre><code>public function onPopulateProfileSettingsTabs(Request $request, array &amp;$tabs): bool
{
$tabs[] = [
'title' =&gt; 'Light theme colours',
'desc' =&gt; 'Change the theme colours.',
'controller' =&gt; C\Oomox::oomoxSettingsLight($request),
];
$tabs[] = [
'title' =&gt; 'Dark theme colours',
'desc' =&gt; 'Change the theme colours.',
'controller' =&gt; C\Oomox::oomoxSettingsDark($request),
];
return Event::next;
}
</code></pre>
<p>As made evident by the code, two new tabs are added to profile settings, light and dark theme colours.
Since the page styling follows the system theme, actors may want to style each theme differently, therefore they are treated separately.</p>
<p>The actor's defined colours are then saved in the respective entity and cached.
Finally, the colour preferences are used to render the corresponding CSS file which defines the various colour variables used:</p>
<pre><code>public function oomoxCSS(): Response
{
$user = Common::ensureLoggedIn();
$oomox_table = PluginOomox::getEntity($user);
if (is_null($oomox_table)) {
throw new ClientException(_m('No custom colours defined', 404));
}
$content = Formatting::twigRenderFile('/oomox/root_override.css.twig', ['oomox' =&gt; $oomox_table]);
return new Response($content, status: 200, headers: ['content-type' =&gt; 'text/css']);
}
</code></pre>
<p>Please note, upon rendering for the first time, page render may be blocked until the resulting file is served. Nonetheless, subsequent page renders
won't experience the issue again. That is, if the file is cached by the browser.</p>
<h2>How it looks</h2>
<p>Tabs added using the "PopulateProfileSettingsTabs" event:
<img src="assets/actor_colour_theme_plugin/settings_change_theme_colours.png" alt="User panel Oomox sections" title="" /></p>
<p>Changing the dark theme colours!
<img src="assets/actor_colour_theme_plugin/settings_change_theme_colours3.png" alt="Dark theme colours selection" title="" /></p>
<p>The result of given changes, please note it's no longer a 'dark' theme.
Given a valid colour, it's the actor's responsibility whether or not the colours make sense. So, go wild!
<img src="assets/actor_colour_theme_plugin/settings_change_theme_colours4.png" alt="The resulting colours in action!" title="" /></p>
<!-- text end -->
<!-- entry end -->
</div>
</div></div>
<footer class="footer l-box is-center">
This site's source is
<a href="https://code.undefinedhackers.net/GNUsocial/gnusocial.rocks">hosted here</a>.
</footer></body></html>

View File

@ -0,0 +1,60 @@
Milestone: Actor colour theme plugin
Actors are now able to set their own colours, through a brand new plugin: "Oomox".
Those accustomed to customising their own desktop should know where the name comes from ;)
## Here's how it works!
The Oomox plugin main class catches the "PopulateProfileSettingsTabs" event upon visiting user panel.
public function onPopulateProfileSettingsTabs(Request $request, array &$tabs): bool
{
$tabs[] = [
'title' => 'Light theme colours',
'desc' => 'Change the theme colours.',
'controller' => C\Oomox::oomoxSettingsLight($request),
];
$tabs[] = [
'title' => 'Dark theme colours',
'desc' => 'Change the theme colours.',
'controller' => C\Oomox::oomoxSettingsDark($request),
];
return Event::next;
}
As made evident by the code, two new tabs are added to profile settings, light and dark theme colours.
Since the page styling follows the system theme, actors may want to style each theme differently, therefore they are treated separately.
The actor's defined colours are then saved in the respective entity and cached.
Finally, the colour preferences are used to render the corresponding CSS file which defines the various colour variables used:
public function oomoxCSS(): Response
{
$user = Common::ensureLoggedIn();
$oomox_table = PluginOomox::getEntity($user);
if (is_null($oomox_table)) {
throw new ClientException(_m('No custom colours defined', 404));
}
$content = Formatting::twigRenderFile('/oomox/root_override.css.twig', ['oomox' => $oomox_table]);
return new Response($content, status: 200, headers: ['content-type' => 'text/css']);
}
Please note, upon rendering for the first time, page render may be blocked until the resulting file is served. Nonetheless, subsequent page renders
won't experience the issue again. That is, if the file is cached by the browser.
## How it looks
Tabs added using the "PopulateProfileSettingsTabs" event:
![User panel Oomox sections](assets/actor_colour_theme_plugin/settings_change_theme_colours.png)
Changing the dark theme colours!
![Dark theme colours selection](assets/actor_colour_theme_plugin/settings_change_theme_colours3.png)
The result of given changes, please note it's no longer a 'dark' theme.
Given a valid colour, it's the actor's responsibility whether or not the colours make sense. So, go wild!
![The resulting colours in action!](assets/actor_colour_theme_plugin/settings_change_theme_colours4.png)