Compare commits
No commits in common. "f07236307abb34d4b1a56780d0dea10f70cf339a" and "6075542071d79fed14655539ebfdfa66249cc3b3" have entirely different histories.
f07236307a
...
6075542071
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -28,7 +28,3 @@ dist-ssr
|
|||
src/data/instances-full.json
|
||||
phanpy-dist.zip
|
||||
phanpy-dist.tar.gz
|
||||
|
||||
# Nix
|
||||
.direnv
|
||||
result
|
||||
|
|
|
@ -43,7 +43,7 @@ Everything is designed and engineered following my taste and vision. This is a p
|
|||
|
||||
- **Status actions (reply, boost, favourite, bookmark, etc) are hidden by default**.<br>They only appear in individual status page. This is to reduce clutter and distraction. It may result in lower engagement, but we're not chasing numbers here.
|
||||
- **Boost is represented with the rocket icon**.<br>The green double arrow icon (retweet for Twitter) doesn't look right for the term "boost". Green rocket looks weird, so I use purple.
|
||||
- ~~**Short usernames (`@username`) are displayed in timelines, instead of the full account username (`@username@instance`)**.<br>Despite the [guideline](https://docs.joinmastodon.org/api/guidelines/#username) mentioned that "Decentralization must be transparent to the user", I don't think we should shove it to the face every single time. There are also some [screen-reader-related accessibility concerns](https://twitter.com/lifeofablindgrl/status/1595864647554502656) with the full username, though this web app is unfortunately not accessible yet.~~ DTTHDon fork displays the full username by default.
|
||||
- **Short usernames (`@username`) are displayed in timelines, instead of the full account username (`@username@instance`)**.<br>Despite the [guideline](https://docs.joinmastodon.org/api/guidelines/#username) mentioned that "Decentralization must be transparent to the user", I don't think we should shove it to the face every single time. There are also some [screen-reader-related accessibility concerns](https://twitter.com/lifeofablindgrl/status/1595864647554502656) with the full username, though this web app is unfortunately not accessible yet.
|
||||
- **No autoplay for video/GIF/whatever in timeline**.<br>The timeline is already a huge mess with lots of people, brands, news and media trying to grab your attention. Let's not make it worse. (Current exception now would be animated emojis.)
|
||||
- **Hash-based URLs**.<br>This web app is not meant to be a full-fledged replacement to Mastodon's existing front-end. There's no SEO, database, serverless or any long-running servers. I could be wrong one day.
|
||||
|
||||
|
|
61
flake.lock
61
flake.lock
|
@ -1,61 +0,0 @@
|
|||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1694529238,
|
||||
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1701253981,
|
||||
"narHash": "sha256-ztaDIyZ7HrTAfEEUt9AtTDNoCYxUdSd6NrRHaYOIxtk=",
|
||||
"owner": "nixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "e92039b55bcd58469325ded85d4f58dd5a4eaf58",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
62
flake.nix
62
flake.nix
|
@ -1,62 +0,0 @@
|
|||
{
|
||||
inputs.nixpkgs.url = github:nixOS/nixpkgs/nixos-unstable;
|
||||
inputs.flake-utils.url = github:numtide/flake-utils;
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
lib = pkgs.lib;
|
||||
|
||||
esbuild = pkgs.buildGoModule rec {
|
||||
pname = "esbuild";
|
||||
version = "0.19.5";
|
||||
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "evanw";
|
||||
repo = "esbuild";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-mIXsPj804jxDd8+jPH8tWnnUj7dXIRwfKTeT4WDWb5c=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ=";
|
||||
|
||||
subPackages = [ "cmd/esbuild" ];
|
||||
|
||||
ldflags = [ "-s" "-w" ];
|
||||
|
||||
meta.mainProgram = "esbuild";
|
||||
};
|
||||
in
|
||||
rec {
|
||||
packages.default = pkgs.buildNpmPackage {
|
||||
pname = "dtth-phanpy";
|
||||
version = "0.1.0";
|
||||
|
||||
nativeBuildInputs = with pkgs; [ git ];
|
||||
ESBUILD_BINARY_PATH = lib.getExe esbuild;
|
||||
|
||||
src = lib.cleanSource ./.;
|
||||
|
||||
npmFlags = [ "--legacy-peer-deps" ];
|
||||
npmDepsHash = "sha256-OkVF70K5xneFRTJiu1qCRIGvWgKWwhHMwCC+elMcVXo=";
|
||||
# npmDepsHash = lib.fakeHash;
|
||||
|
||||
# DTTH-specific env variables
|
||||
PHANPY_CLIENT_NAME = "DTTH Phanpy";
|
||||
PHANPY_CLIENT_ID = "ch.dtth.phanpy";
|
||||
PHANPY_WEBSITE = "https://social.dtth.ch";
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/lib
|
||||
cp -r dist $out/lib/phanpy
|
||||
runHook postInstall
|
||||
'';
|
||||
};
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
inputsFrom = [ packages.default ];
|
||||
buildInputs = with pkgs; [ nodejs ];
|
||||
};
|
||||
});
|
||||
}
|
|
@ -2665,8 +2665,8 @@ ul.link-list li a .icon {
|
|||
padding: 32px;
|
||||
} */
|
||||
li.timeline-item-carousel {
|
||||
/* width: 95vw;
|
||||
max-width: calc(320px * 3.3); */
|
||||
width: 95vw;
|
||||
max-width: calc(320px * 3.3);
|
||||
transform: translateX(calc(-50% + var(--main-width) / 2));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,5 +99,4 @@ export const ICONS = {
|
|||
speak: () => import('@iconify-icons/mingcute/radar-line'),
|
||||
building: () => import('@iconify-icons/mingcute/building-5-line'),
|
||||
history: () => import('@iconify-icons/mingcute/history-2-line'),
|
||||
'user-setting': () => import('@iconify-icons/mingcute/user-setting-line'),
|
||||
};
|
||||
|
|
|
@ -15,9 +15,6 @@ a.name-text.short:is(:hover, :focus) i {
|
|||
font-style: normal;
|
||||
opacity: 0.75;
|
||||
}
|
||||
.name-text i.instance {
|
||||
opacity: 0.35;
|
||||
}
|
||||
|
||||
.name-text .avatar {
|
||||
vertical-align: middle;
|
||||
|
|
|
@ -72,13 +72,12 @@ function NameText({
|
|||
<b>
|
||||
<EmojiText text={displayName} emojis={emojis} />
|
||||
</b>
|
||||
{!showAcct && username ? (
|
||||
{!showAcct && username && (
|
||||
<>
|
||||
{' '}
|
||||
<i>@{username}</i>
|
||||
</>
|
||||
) : ' '}
|
||||
<i class="instance">{acct2}</i>
|
||||
)}
|
||||
</>
|
||||
) : short ? (
|
||||
<i>{username}</i>
|
||||
|
|
|
@ -13,7 +13,6 @@ import store from '../utils/store';
|
|||
import Avatar from './avatar';
|
||||
import Icon from './icon';
|
||||
import MenuLink from './menu-link';
|
||||
import { accountsIsDtth, gtsDtthSettings } from '../utils/dtth';
|
||||
|
||||
function NavMenu(props) {
|
||||
const snapStates = useSnapshot(states);
|
||||
|
@ -221,10 +220,6 @@ function NavMenu(props) {
|
|||
<Icon icon="user" size="l" /> <span>Profile</span>
|
||||
</MenuLink>
|
||||
)}
|
||||
{currentAccount && accountsIsDtth(currentAccount) &&
|
||||
<a href={gtsDtthSettings} target='_blank' title="Takes you to DTTHDon settings"> <MenuItem>
|
||||
<Icon icon="user-setting" size="l" /> <span>User Settings…</span>
|
||||
</MenuItem></a>}
|
||||
<MenuItem
|
||||
onClick={() => {
|
||||
states.showAccounts = true;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
--sai-left: env(safe-area-inset-left);
|
||||
|
||||
--text-size: 16px;
|
||||
--main-width: max(60dvw, 40em);
|
||||
--main-width: 40em;
|
||||
text-size-adjust: none;
|
||||
--hairline-width: 1px;
|
||||
--monospace-font: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono',
|
||||
|
|
|
@ -11,7 +11,6 @@ import instancesListURL from '../data/instances.json?url';
|
|||
import { getAuthorizationURL, registerApplication } from '../utils/auth';
|
||||
import store from '../utils/store';
|
||||
import useTitle from '../utils/useTitle';
|
||||
import { gtsDtth } from '../utils/dtth';
|
||||
|
||||
const { PHANPY_DEFAULT_INSTANCE: DEFAULT_INSTANCE } = import.meta.env;
|
||||
|
||||
|
@ -24,7 +23,7 @@ function Login() {
|
|||
const instance = searchParams.get('instance');
|
||||
const submit = searchParams.get('submit');
|
||||
const [instanceText, setInstanceText] = useState(
|
||||
instance || cachedInstanceURL?.toLowerCase() || gtsDtth,
|
||||
instance || cachedInstanceURL?.toLowerCase() || '',
|
||||
);
|
||||
|
||||
const [instancesList, setInstancesList] = useState([]);
|
||||
|
|
|
@ -538,18 +538,14 @@ function Settings({ onClose }) {
|
|||
}}
|
||||
>
|
||||
@phanpy
|
||||
</a> (
|
||||
<a href="https://git.dtth.ch/nki/phanpy" target="_blank">
|
||||
DTTH Fork
|
||||
</a>
|
||||
)
|
||||
<br />
|
||||
<a
|
||||
href="https://github.com/cheeaun/phanpy"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
Original
|
||||
Built
|
||||
</a>{' '}
|
||||
by{' '}
|
||||
<a
|
||||
|
@ -604,10 +600,10 @@ function Settings({ onClose }) {
|
|||
type="text"
|
||||
class="version-string"
|
||||
readOnly
|
||||
size={10 /* build time */ + (1+8) /* commit hash */ + '-dtth'.length}
|
||||
size="18" // Manually calculated here
|
||||
value={`${__BUILD_TIME__.slice(0, 10).replace(/-/g, '.')}${
|
||||
__COMMIT_HASH__ ? `.${__COMMIT_HASH__.slice(0, 8)}` : ''
|
||||
}-dtth`}
|
||||
__COMMIT_HASH__ ? `.${__COMMIT_HASH__}` : ''
|
||||
}`}
|
||||
onClick={(e) => {
|
||||
e.target.select();
|
||||
// Copy to clipboard
|
||||
|
@ -624,7 +620,7 @@ function Settings({ onClose }) {
|
|||
<span class="ib insignificant">
|
||||
(
|
||||
<a
|
||||
href={`https://git.dtth.ch/nki/phanpy/commit/${__COMMIT_HASH__}`}
|
||||
href={`https://github.com/cheeaun/phanpy/commit/${__COMMIT_HASH__}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
|
|
|
@ -104,7 +104,6 @@ function Welcome() {
|
|||
</a>
|
||||
.
|
||||
</p>
|
||||
<p class="desc">A minimalistic opinionated DTTHDon web client.</p>
|
||||
</div>
|
||||
<div id="why-container">
|
||||
<div class="sections">
|
||||
|
@ -163,38 +162,6 @@ function Welcome() {
|
|||
</section>
|
||||
</div>
|
||||
</div>
|
||||
<footer>
|
||||
<hr />
|
||||
<p>
|
||||
<a href="https://git.dtth.ch/nki/phanpy" target="_blank">
|
||||
DTTHDon Fork
|
||||
</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="https://github.com/cheeaun/phanpy" target="_blank">
|
||||
Original built
|
||||
</a>{' '}
|
||||
by{' '}
|
||||
<a
|
||||
href="https://mastodon.social/@cheeaun"
|
||||
target="_blank"
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
states.showAccount = 'cheeaun@mastodon.social';
|
||||
}}
|
||||
>
|
||||
@cheeaun
|
||||
</a>
|
||||
.{' '}
|
||||
<a
|
||||
href="https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD"
|
||||
target="_blank"
|
||||
>
|
||||
Privacy Policy
|
||||
</a>
|
||||
.
|
||||
</p>
|
||||
</footer>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
export function accountsIsDtth(account) {
|
||||
return (
|
||||
account.info &&
|
||||
typeof account.info.url === 'string' &&
|
||||
account.info.url.startsWith(gtsDtth)
|
||||
);
|
||||
}
|
||||
|
||||
/** URL to DTTHDon */
|
||||
export const gtsDtth = 'https://gts.dtth.ch';
|
||||
|
||||
/** URL to DTTHDon settings */
|
||||
export const gtsDtthSettings = 'https://gts.dtth.ch/settings';
|
|
@ -24,13 +24,9 @@ try {
|
|||
} catch (error) {
|
||||
// If error, means git is not installed or not a git repo (could be downloaded instead of git cloned)
|
||||
// Fallback to random hash which should be different on every build run 🤞
|
||||
if (process.env.PHANPY_COMMIT_HASH) {
|
||||
commitHash = process.env.PHANPY_COMMIT_HASH;
|
||||
} else {
|
||||
commitHash = uid();
|
||||
fakeCommitHash = true;
|
||||
}
|
||||
}
|
||||
|
||||
const rollbarCode = fs.readFileSync(
|
||||
resolve(__dirname, './rollbar.js'),
|
||||
|
|
Loading…
Reference in a new issue