Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance: 非ログイン時には別サーバーに遷移できるように #13089

Merged
merged 21 commits into from
Jul 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
51d62a0
enhance: 非ログイン時にはMisskey Hub経由で別サーバーに遷移できるように
kakkokari-gtyih Jan 26, 2024
54a6a6d
fix
kakkokari-gtyih Jan 27, 2024
ee41be2
Merge branch 'develop' into enh-12998
kakkokari-gtyih Jan 27, 2024
9bbc612
Merge branch 'develop' into enh-12998
kakkokari-gtyih Jan 27, 2024
8480323
Merge branch 'develop' into enh-12998
kakkokari-gtyih Jan 28, 2024
5a51102
Merge branch 'develop' into enh-12998
kakkokari-gtyih Jan 28, 2024
455ddf3
サーバーサイド照会を削除
kakkokari-gtyih Jan 28, 2024
3f8e1e2
Merge branch 'enh-12998' of https://github.com/kakkokari-gtyih/misske…
kakkokari-gtyih Jan 28, 2024
0cc2b01
Merge branch 'develop' into enh-12998
kakkokari-gtyih Jan 28, 2024
872fba9
クライアント側の照会動作
kakkokari-gtyih Jan 28, 2024
f2e4428
hubを経由せずにリモートで続行できるように
kakkokari-gtyih Jan 28, 2024
484bc8b
fix と pleaseLogin誘導箇所の追加
kakkokari-gtyih Jan 28, 2024
96c07cd
fix
kakkokari-gtyih Jan 28, 2024
2c7ae92
Merge branch 'develop' into enh-12998
kakkokari-gtyih Mar 4, 2024
aeeac2f
fix
kakkokari-gtyih Mar 4, 2024
31e9a84
Merge branch 'develop' into enh-12998
kakkokari-gtyih Mar 4, 2024
7ddc6ee
Merge branch 'develop' into enh-12998
kakkokari-gtyih Mar 4, 2024
1372589
Merge branch 'develop' into enh-12998
kakkokari-gtyih Jun 9, 2024
a0da333
Merge branch 'develop' into enh-12998
kakkokari-gtyih Jul 11, 2024
076786c
Update CHANGELOG.md
kakkokari-gtyih Jul 11, 2024
3ebc03b
Merge branch 'develop' into enh-12998
syuilo Jul 14, 2024
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

### Client
- Enhance: 内蔵APIドキュメントのデザイン・パフォーマンスを改善
- Enhance: 非ログイン時に他サーバーに遷移するアクションを追加
- Enhance: 非ログイン時のハイライトTLのデザインを改善
- Enhance: フロントエンドのアクセシビリティ改善
(Based on https://github.com/taiyme/misskey/pull/226)
Expand Down
26 changes: 25 additions & 1 deletion locales/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,22 @@ export interface Locale extends ILocale {
* リモートで表示
*/
"showOnRemote": string;
/**
* リモートで続行
*/
"continueOnRemote": string;
/**
* Misskey Hubからサーバーを選択
*/
"chooseServerOnMisskeyHub": string;
/**
* サーバーのドメインを直接指定
*/
"specifyServerHost": string;
/**
* ドメインを入力してください
*/
"inputHostName": string;
/**
* 全般
*/
Expand Down Expand Up @@ -1921,9 +1937,13 @@ export interface Locale extends ILocale {
*/
"onlyOneFileCanBeAttached": string;
/**
* 続行する前に、サインアップまたはサインインが必要です
* 続行する前に、登録またはログインが必要です
*/
"signinRequired": string;
/**
* 続行するには、お使いのサーバーに移動するか、このサーバーに登録・ログインする必要があります
*/
"signinOrContinueOnRemote": string;
/**
* 招待
*/
Expand Down Expand Up @@ -4984,6 +5004,10 @@ export interface Locale extends ILocale {
* お問い合わせ
*/
"inquiry": string;
/**
* もう一度お試しください。
*/
"tryAgain": string;
"_delivery": {
/**
* 配信状態
Expand Down
8 changes: 7 additions & 1 deletion locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ addAccount: "アカウントを追加"
reloadAccountsList: "アカウントリストの情報を更新"
loginFailed: "ログインに失敗しました"
showOnRemote: "リモートで表示"
continueOnRemote: "リモートで続行"
chooseServerOnMisskeyHub: "Misskey Hubからサーバーを選択"
specifyServerHost: "サーバーのドメインを直接指定"
inputHostName: "ドメインを入力してください"
general: "全般"
wallpaper: "壁紙"
setWallpaper: "壁紙を設定"
Expand Down Expand Up @@ -476,7 +480,8 @@ attachAsFileQuestion: "クリップボードのテキストが長いです。テ
noMessagesYet: "まだチャットはありません"
newMessageExists: "新しいメッセージがあります"
onlyOneFileCanBeAttached: "メッセージに添付できるファイルはひとつです"
signinRequired: "続行する前に、サインアップまたはサインインが必要です"
signinRequired: "続行する前に、登録またはログインが必要です"
signinOrContinueOnRemote: "続行するには、お使いのサーバーに移動するか、このサーバーに登録・ログインする必要があります"
invitations: "招待"
invitationCode: "招待コード"
checking: "確認しています"
Expand Down Expand Up @@ -1242,6 +1247,7 @@ keepOriginalFilenameDescription: "この設定をオフにすると、アップ
noDescription: "説明文はありません"
alwaysConfirmFollow: "フォローの際常に確認する"
inquiry: "お問い合わせ"
tryAgain: "もう一度お試しください。"

_delivery:
status: "配信状態"
Expand Down
6 changes: 5 additions & 1 deletion packages/frontend/src/components/MkFollowButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ import { misskeyApi } from '@/scripts/misskey-api.js';
import { useStream } from '@/stream.js';
import { i18n } from '@/i18n.js';
import { claimAchievement } from '@/scripts/achievements.js';
import { pleaseLogin } from '@/scripts/please-login.js';
import { host } from '@/config.js';
import { $i } from '@/account.js';
import { defaultStore } from '@/store.js';

Expand All @@ -63,7 +65,7 @@ const hasPendingFollowRequestFromYou = ref(props.user.hasPendingFollowRequestFro
const wait = ref(false);
const connection = useStream().useChannel('main');

if (props.user.isFollowing == null) {
if (props.user.isFollowing == null && $i) {
misskeyApi('users/show', {
userId: props.user.id,
})
Expand All @@ -78,6 +80,8 @@ function onFollowChange(user: Misskey.entities.UserDetailed) {
}

async function onClick() {
pleaseLogin(undefined, { type: 'web', path: `/@${props.user.username}@${props.user.host ?? host}` });

wait.value = true;

try {
Expand Down
14 changes: 10 additions & 4 deletions packages/frontend/src/components/MkNote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ import { MenuItem } from '@/types/menu.js';
import MkRippleEffect from '@/components/MkRippleEffect.vue';
import { showMovedDialog } from '@/scripts/show-moved-dialog.js';
import { shouldCollapsed } from '@/scripts/collapsed.js';
import { host } from '@/config.js';
import { isEnabledUrlPreview } from '@/instance.js';
import { type Keymap } from '@/scripts/hotkey.js';
import { focusPrev, focusNext } from '@/scripts/focus.js';
Expand Down Expand Up @@ -278,6 +279,11 @@ const renoteCollapsed = ref(
),
);

const pleaseLoginContext = {
type: 'lookup',
path: `https://${host}/notes/${appearNote.value.id}`,
} as const;

/* Overload FunctionにLintが対応していないのでコメントアウト
function checkMute(noteToCheck: Misskey.entities.Note, mutedWords: Array<string | string[]> | undefined | null, checkOnly: true): boolean;
function checkMute(noteToCheck: Misskey.entities.Note, mutedWords: Array<string | string[]> | undefined | null, checkOnly: false): boolean | 'sensitiveMute';
Expand Down Expand Up @@ -411,7 +417,7 @@ if (!props.mock) {
}

function renote(viaKeyboard = false) {
pleaseLogin();
pleaseLogin(undefined, pleaseLoginContext);
showMovedDialog();

const { menu } = getRenoteMenu({ note: note.value, renoteButton, mock: props.mock });
Expand All @@ -421,7 +427,7 @@ function renote(viaKeyboard = false) {
}

function reply(): void {
pleaseLogin();
pleaseLogin(undefined, pleaseLoginContext);
if (props.mock) {
return;
}
Expand All @@ -434,7 +440,7 @@ function reply(): void {
}

function react(): void {
pleaseLogin();
pleaseLogin(undefined, pleaseLoginContext);
showMovedDialog();
if (appearNote.value.reactionAcceptance === 'likeOnly') {
sound.playMisskeySfx('reaction');
Expand Down Expand Up @@ -565,7 +571,7 @@ function showRenoteMenu(): void {
}

if (isMyRenote) {
pleaseLogin();
pleaseLogin(undefined, pleaseLoginContext);
os.popupMenu([
getCopyNoteLinkMenu(note.value, i18n.ts.copyLinkRenote),
{ type: 'divider' },
Expand Down
14 changes: 10 additions & 4 deletions packages/frontend/src/components/MkNoteDetailed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ import { reactionPicker } from '@/scripts/reaction-picker.js';
import { extractUrlFromMfm } from '@/scripts/extract-url-from-mfm.js';
import { $i } from '@/account.js';
import { i18n } from '@/i18n.js';
import { host } from '@/config.js';
import { getNoteClipMenu, getNoteMenu, getRenoteMenu } from '@/scripts/get-note-menu.js';
import { useNoteCapture } from '@/scripts/use-note-capture.js';
import { deepClone } from '@/scripts/clone.js';
Expand Down Expand Up @@ -296,6 +297,11 @@ const conversation = ref<Misskey.entities.Note[]>([]);
const replies = ref<Misskey.entities.Note[]>([]);
const canRenote = computed(() => ['public', 'home'].includes(appearNote.value.visibility) || appearNote.value.userId === $i?.id);

const pleaseLoginContext = {
type: 'lookup',
path: `https://${host}/notes/${appearNote.value.id}`,
} as const;

const keymap = {
'r': () => reply(),
'e|a|plus': () => react(),
Expand Down Expand Up @@ -396,15 +402,15 @@ if (appearNote.value.reactionAcceptance === 'likeOnly') {
}

function renote() {
pleaseLogin();
pleaseLogin(undefined, pleaseLoginContext);
showMovedDialog();

const { menu } = getRenoteMenu({ note: note.value, renoteButton });
os.popupMenu(menu, renoteButton.value);
}

function reply(): void {
pleaseLogin();
pleaseLogin(undefined, pleaseLoginContext);
showMovedDialog();
os.post({
reply: appearNote.value,
Expand All @@ -415,7 +421,7 @@ function reply(): void {
}

function react(): void {
pleaseLogin();
pleaseLogin(undefined, pleaseLoginContext);
showMovedDialog();
if (appearNote.value.reactionAcceptance === 'likeOnly') {
sound.playMisskeySfx('reaction');
Expand Down Expand Up @@ -499,7 +505,7 @@ async function clip(): Promise<void> {

function showRenoteMenu(): void {
if (!isMyRenote) return;
pleaseLogin();
pleaseLogin(undefined, pleaseLoginContext);
os.popupMenu([{
text: i18n.ts.unrenote,
icon: 'ti ti-trash',
Expand Down
8 changes: 7 additions & 1 deletion packages/frontend/src/components/MkPoll.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { pleaseLogin } from '@/scripts/please-login.js';
import * as os from '@/os.js';
import { misskeyApi } from '@/scripts/misskey-api.js';
import { i18n } from '@/i18n.js';
import { host } from '@/config.js';
import { useInterval } from '@/scripts/use-interval.js';

const props = defineProps<{
Expand All @@ -60,6 +61,11 @@ const timer = computed(() => i18n.tsx._poll[

const showResult = ref(props.readOnly || isVoted.value);

const pleaseLoginContext = {
type: 'lookup',
path: `https://${host}/notes/${props.note.id}`,
} as const;

// 期限付きアンケート
if (props.poll.expiresAt) {
const tick = () => {
Expand All @@ -76,7 +82,7 @@ if (props.poll.expiresAt) {
}

const vote = async (id) => {
pleaseLogin();
pleaseLogin(undefined, pleaseLoginContext);

if (props.readOnly || closed.value || isVoted.value) return;

Expand Down
Loading
Loading