Radial Status: fix ring oversizing, switch to additive px growth
This commit is contained in:
parent
83e474b45a
commit
d5364e3a62
4 changed files with 27 additions and 23 deletions
|
|
@ -8,23 +8,22 @@ let unpatchAll: () => void = () => {};
|
|||
|
||||
export default {
|
||||
onLoad: () => {
|
||||
// Force-disabled this release (not just `??=`, since storage.enabled is already persisted as
|
||||
// true on devices that had the previous version) - the size+childCount whitelist added for
|
||||
// YouBar/profile/DM-list coverage turned out to also false-positive on guild icons in the
|
||||
// server list sidebar (confirmed on-device: every guild icon got painted with a ring). Will
|
||||
// stop force-disabling once a live capture pins down what actually distinguishes a real
|
||||
// user-presence wrapper from a guild-icon wrapper that happens to share the same shape.
|
||||
if (storage.forceDisabledV2 !== true) {
|
||||
storage.enabled = false;
|
||||
storage.forceDisabledV2 = true;
|
||||
// The previous release's force-disable (storage.forceDisabledV2) was based on a misdiagnosis -
|
||||
// what looked like a guild-icon false positive was actually the DM list rendering correctly.
|
||||
// The real issue was the size-multiplier growth model being disproportionate on larger avatars
|
||||
// (confirmed on-device: "way too big" on YouBar) - fixed in ringPatch.ts by switching to a
|
||||
// fixed-px additive growth instead of a percentage multiplier. Force re-enabling once now that
|
||||
// the actual defect is fixed, superseding the old force-disable flag.
|
||||
if (storage.forceReenabledV3 !== true) {
|
||||
storage.enabled = true;
|
||||
storage.forceReenabledV3 = true;
|
||||
}
|
||||
storage.colors ??= {
|
||||
online: "#23A55A",
|
||||
idle: "#F0B232",
|
||||
dnd: "#F23F42"
|
||||
};
|
||||
storage.ringMult ??= 1.3;
|
||||
storage.ringThickness ??= 2.5;
|
||||
storage.ringThickness ??= 2;
|
||||
|
||||
unpatchAll = applyPatches("Radial Status", logger, {
|
||||
ring: patchRing
|
||||
|
|
|
|||
|
|
@ -47,8 +47,14 @@ export default function patchRing(): () => void {
|
|||
if (!color) return; // no color configured for this status - leave the native dot alone
|
||||
|
||||
const baseSize = wrapper.style[circleIdx].width;
|
||||
const mult = storage.ringMult ?? 1.3;
|
||||
const thickness = storage.ringThickness ?? 2.5;
|
||||
// Growth is additive (a fixed number of px on each side), not a percentage multiplier -
|
||||
// a flat multiplier applied the same 30% growth everywhere, which meant a much bigger
|
||||
// ABSOLUTE size increase on large avatars (e.g. +24px at YouBar's 80px size) than on small
|
||||
// ones (+9.6px at a 32px member-list row) even though the relative growth was identical.
|
||||
// That's confirmed on-device as "slightly too big" on member list/profile and "way too big"
|
||||
// on YouBar - additive growth keeps the ring the same absolute thickness everywhere instead.
|
||||
const thickness = storage.ringThickness ?? 2;
|
||||
const newSize = baseSize + thickness * 2;
|
||||
|
||||
presenceProps.size = 0;
|
||||
presenceProps.isMobileOnline = false;
|
||||
|
|
@ -56,13 +62,13 @@ export default function patchRing(): () => void {
|
|||
if (userProps.cutout?.nativeCutouts?.[0]) userProps.cutout.nativeCutouts[0].size = 0;
|
||||
|
||||
wrapper.style[circleIdx] = {
|
||||
width: baseSize * mult,
|
||||
height: baseSize * mult,
|
||||
borderRadius: (baseSize / 2) * mult,
|
||||
width: newSize,
|
||||
height: newSize,
|
||||
borderRadius: newSize / 2,
|
||||
overflow: "hidden"
|
||||
};
|
||||
wrapper.style.push({
|
||||
borderWidth: thickness * mult,
|
||||
borderWidth: thickness,
|
||||
borderColor: color,
|
||||
borderStyle: "solid"
|
||||
});
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ const STATUSES: { key: string; label: string; defaultColor?: string }[] = [
|
|||
{ key: "offline", label: "Offline", defaultColor: "#80848E" }
|
||||
];
|
||||
|
||||
function numberInput(title: string, key: "ringMult" | "ringThickness", placeholder: string) {
|
||||
function numberInput(title: string, key: "ringThickness", placeholder: string) {
|
||||
return (
|
||||
<FormInput
|
||||
title={title}
|
||||
|
|
@ -68,8 +68,7 @@ export default function Settings() {
|
|||
))}
|
||||
</FormSection>
|
||||
<FormSection title="Ring size">
|
||||
{numberInput("Size multiplier", "ringMult", "1.3")}
|
||||
{numberInput("Ring thickness", "ringThickness", "2.5")}
|
||||
{numberInput("Ring thickness", "ringThickness", "2")}
|
||||
</FormSection>
|
||||
</SettingsScaffold>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@
|
|||
"status": "revived",
|
||||
"accent": "#23A55A",
|
||||
"tagline": "A colored ring around the avatar instead of a presence dot - similar to Platform Indicator, but for status.",
|
||||
"note": "Fork of AngelW0lf's Radial Status (BSD-3-Clause, see LICENSE). Upstream had a phone-home mechanism - it fetched a remote blacklist on every load and could silently uninstall itself for specific user IDs the original author chose - dropped entirely here, no network requests at all. Upstream only ever matched one exact avatar size (member list-style rows), missing YouBar, the profile screen, and DM lists entirely. On-device capture across all of those contexts confirmed the real presence-carrying wrapper sizes (24, 32, 40, 50, 60, 80px) all share the same shape - square, half-width border radius, exactly 5 children - so this fork matches that confirmed whitelist instead of either upstream's single size or an earlier overly-broad generalization that briefly caused visible corruption elsewhere on-device. Upstream's settings screen had commented-out, non-functional size/thickness inputs and an unfinished joke placeholder button - both removed, with real working size and thickness controls in their place.",
|
||||
"howItWorks": "Hides the small colored dot Discord shows on an avatar for online/idle/DND/offline, and draws a colored ring around the whole avatar instead - similar in spirit to a platform indicator, but for presence status. Each status's color is independently configurable (including offline, which Discord doesn't normally show a dot for at all), along with the ring's size multiplier and thickness. A status left with no color configured just keeps showing the normal dot.",
|
||||
"note": "Fork of AngelW0lf's Radial Status (BSD-3-Clause, see LICENSE). Upstream had a phone-home mechanism - it fetched a remote blacklist on every load and could silently uninstall itself for specific user IDs the original author chose - dropped entirely here, no network requests at all. Upstream only ever matched one exact avatar size (member list-style rows), missing YouBar, the profile screen, and DM lists entirely. On-device capture across all of those contexts confirmed the real presence-carrying wrapper sizes (24, 32, 40, 50, 60, 80px) all share the same shape - square, half-width border radius, exactly 5 children - so this fork matches that confirmed whitelist instead of either upstream's single size or an earlier overly-broad generalization that briefly caused visible corruption elsewhere on-device. Also switched the ring's size growth from a percentage multiplier to a fixed pixel amount: a flat multiplier applied the same 30% growth everywhere, which meant a much bigger absolute size increase on large avatars (confirmed on-device as noticeably oversized on YouBar) than on small ones - fixed-px growth keeps the ring the same absolute thickness regardless of avatar size. Upstream's settings screen had commented-out, non-functional size/thickness inputs and an unfinished joke placeholder button - both removed, with a real working thickness control in their place.",
|
||||
"howItWorks": "Hides the small colored dot Discord shows on an avatar for online/idle/DND/offline, and draws a colored ring around the whole avatar instead - similar in spirit to a platform indicator, but for presence status. Each status's color is independently configurable (including offline, which Discord doesn't normally show a dot for at all), along with the ring's thickness. A status left with no color configured just keeps showing the normal dot.",
|
||||
"features": [
|
||||
"Colored ring around the avatar instead of the small presence dot",
|
||||
"Independent color per status: online, idle, do not disturb, offline",
|
||||
"Adjustable ring size multiplier and thickness",
|
||||
"Adjustable ring thickness, sized consistently across every avatar context",
|
||||
"No network requests - upstream's remote blacklist/kill-switch mechanism was removed entirely"
|
||||
],
|
||||
"commands": [],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue