Skip to content

Commit

Permalink
Merge pull request #1 from anatawa12/niri-la-pick-some-important-changes
Browse files Browse the repository at this point in the history
pick some important changes from 13.14
  • Loading branch information
niwaniwa authored Jul 13, 2023
2 parents 79b3817 + 60f48f5 commit b0cb4f0
Show file tree
Hide file tree
Showing 12 changed files with 124 additions and 17 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@
-->

## 13.x.x (unreleased)

### General

### Client
- deck UIのカラムのメニューからアンテナとリストの編集画面を開けるように
- 画像を動画と同様に簡単に隠せるように
- 見たことのあるRenoteを省略して表示をオンのときに自分のnoteのrenoteを省略するように
- フォローやお気に入り登録をしていないチャンネルを開く時は概要ページを開くように
- 引用対象を「もっと見る」で展開した場合、「閉じる」で畳めるように
- Renote時に公開範囲のデフォルト設定が適用されるように
- 画面ビューワをタップした場合、マウスクリックと同様に画像ビューワを閉じるように
- Fix: 長い文章を投稿する際、プレビューが画面からはみ出る問題を修正

### Server

## 13.13.2

### General
Expand Down
2 changes: 2 additions & 0 deletions locales/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,10 @@ export interface Locale {
"suspendConfirm": string;
"unsuspendConfirm": string;
"selectList": string;
"editList": string;
"selectChannel": string;
"selectAntenna": string;
"editAntenna": string;
"selectWidget": string;
"editWidgets": string;
"editWidgetsExit": string;
Expand Down
2 changes: 2 additions & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,10 @@ unblockConfirm: "ブロック解除しますか?"
suspendConfirm: "凍結しますか?"
unsuspendConfirm: "解凍しますか?"
selectList: "リストを選択"
editList: "リストを編集"
selectChannel: "チャンネルを選択"
selectAntenna: "アンテナを選択"
editAntenna: "アンテナを編集"
selectWidget: "ウィジェットを選択"
editWidgets: "ウィジェットを編集"
editWidgetsExit: "編集を終了"
Expand Down
16 changes: 16 additions & 0 deletions packages/frontend/src/components/MkMediaImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<div v-if="image.isSensitive" :class="$style.indicator" style="color: var(--warn);">NSFW</div>
</div>
<button :class="$style.menu" class="_button" @click.stop="showMenu"><i class="ti ti-dots" style="vertical-align: middle;"></i></button>
<i class="ti ti-eye-off" :class="$style.hide" @click.stop="hide = true"></i>
</template>
</div>
</template>
Expand Down Expand Up @@ -113,6 +114,21 @@ function showMenu(ev: MouseEvent) {
align-items: center;
}
.hide {
display: block;
position: absolute;
border-radius: 6px;
background-color: var(--fg);
color: var(--accentLighten);
font-size: 14px;
opacity: .5;
padding: 3px 6px;
text-align: center;
cursor: pointer;
top: 12px;
right: 12px;
}
.hiddenTextWrapper {
display: table-cell;
text-align: center;
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkMediaList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ onMounted(() => {
right: 0,
},
imageClickAction: 'close',
tapAction: 'toggle-controls',
tapAction: 'close',
bgOpacity: 1,
pswpModule: PhotoSwipe,
});
Expand Down
18 changes: 17 additions & 1 deletion packages/frontend/src/components/MkNote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ const translation = ref<any>(null);
const translating = ref(false);
const showTicker = (defaultStore.state.instanceTicker === 'always') || (defaultStore.state.instanceTicker === 'remote' && appearNote.user.instance);
const canRenote = computed(() => ['public', 'home'].includes(appearNote.visibility) || appearNote.userId === $i.id);
let renoteCollapsed = $ref(defaultStore.state.collapseRenotes && isRenote && (($i && ($i.id === note.userId)) || (appearNote.myReaction != null)));
let renoteCollapsed = $ref(defaultStore.state.collapseRenotes && isRenote && (($i && ($i.id === note.userId || $i.id === appearNote.userId)) || (appearNote.myReaction != null)));
const keymap = {
'r': () => reply(true),
Expand Down Expand Up @@ -259,6 +259,17 @@ useTooltip(renoteButton, async (showing) => {
}, {}, 'closed');
});
type Visibility = 'public' | 'home' | 'followers' | 'specified';
// defaultStore.state.visibilityがstringなためstringも受け付けている
function smallerVisibility(a: Visibility | string, b: Visibility | string): Visibility {
if (a === 'specified' || b === 'specified') return 'specified';
if (a === 'followers' || b === 'followers') return 'followers';
if (a === 'home' || b === 'home') return 'home';
// if (a === 'public' || b === 'public')
return 'public';
}
function renote(viaKeyboard = false) {
pleaseLogin();
showMovedDialog();
Expand Down Expand Up @@ -309,7 +320,12 @@ function renote(viaKeyboard = false) {
os.popup(MkRippleEffect, { x, y }, {}, 'end');
}
const configuredVisibility = defaultStore.state.rememberNoteVisibility ? defaultStore.state.visibility : defaultStore.state.defaultNoteVisibility;
const localOnly = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly;
os.api('notes/create', {
localOnly,
visibility: smallerVisibility(appearNote.visibility, configuredVisibility),
renoteId: appearNote.id,
}).then(() => {
os.toast(i18n.ts.renoted);
Expand Down
2 changes: 2 additions & 0 deletions packages/frontend/src/components/MkPostForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1015,6 +1015,8 @@ defineExpose({
.preview {
padding: 16px 20px 0 20px;
max-height: 150px;
overflow: auto;
}
.targetNote {
Expand Down
9 changes: 8 additions & 1 deletion packages/frontend/src/components/MkPostFormDialog.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<MkModal ref="modal" :preferType="'dialog'" @click="modal.close()" @closed="onModalClosed()">
<MkPostForm ref="form" style="margin: 0 auto auto auto;" v-bind="props" autofocus freezeAfterPosted @posted="onPosted" @cancel="modal.close()" @esc="modal.close()"/>
<MkPostForm ref="form" :class="$style.form" v-bind="props" autofocus freezeAfterPosted @posted="onPosted" @cancel="modal.close()" @esc="modal.close()"/>
</MkModal>
</template>

Expand Down Expand Up @@ -44,3 +44,10 @@ function onModalClosed() {
emit('closed');
}
</script>

<style lang="scss" module>
.form {
max-height: 100%;
margin: 0 auto auto auto;
}
</style>
27 changes: 24 additions & 3 deletions packages/frontend/src/components/MkSubNoteContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
<summary>{{ i18n.ts.poll }}</summary>
<MkPoll :note="note"/>
</details>
<button v-if="collapsed" :class="$style.fade" class="_button" @click="collapsed = false">
<button v-if="isLong && collapsed" :class="$style.fade" class="_button" @click="collapsed = false">
<span :class="$style.fadeLabel">{{ i18n.ts.showMore }}</span>
</button>
<button v-else-if="isLong && !collapsed" :class="$style.showLess" class="_button" @click="collapsed = true">
<span :class="$style.showLessLabel">{{ i18n.ts.showLess }}</span>
</button>
</div>
</template>

Expand All @@ -33,11 +36,13 @@ const props = defineProps<{
note: misskey.entities.Note;
}>();
const collapsed = $ref(
const isLong =
props.note.cw == null && props.note.text != null && (
(props.note.text.split('\n').length > 9) ||
(props.note.text.length > 500)
));
);
const collapsed = $ref(isLong);
</script>

<style lang="scss" module>
Expand Down Expand Up @@ -86,4 +91,20 @@ const collapsed = $ref(
font-style: oblique;
color: var(--renote);
}
.showLess {
width: 100%;
margin-top: 14px;
position: sticky;
bottom: calc(var(--stickyBottom, 0px) + 14px);
}
.showLessLabel {
display: inline-block;
background: var(--popup);
padding: 6px 10px;
font-size: 0.8em;
border-radius: 999px;
box-shadow: 0 2px 6px rgb(0 0 0 / 20%);
}
</style>
5 changes: 4 additions & 1 deletion packages/frontend/src/pages/channel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const props = defineProps<{
channelId: string;
}>();
let tab = $ref('timeline');
let tab = $ref('overview');
let channel = $ref(null);
let favorited = $ref(false);
let searchQuery = $ref('');
Expand All @@ -107,6 +107,9 @@ watch(() => props.channelId, async () => {
channelId: props.channelId,
});
favorited = channel.isFavorited;
if (favorited || channel.isFollowing) {
tab = 'timeline';
}
}, { immediate: true });
function edit() {
Expand Down
21 changes: 16 additions & 5 deletions packages/frontend/src/ui/deck/antenna-column.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,22 @@ async function setAntenna() {
});
}
const menu = [{
icon: 'ti ti-pencil',
text: i18n.ts.selectAntenna,
action: setAntenna,
}];
function editAntenna() {
os.pageWindow('my/antennas/' + props.column.antennaId);
}
const menu = [
{
icon: 'ti ti-pencil',
text: i18n.ts.selectAntenna,
action: setAntenna,
},
{
icon: 'ti ti-settings',
text: i18n.ts.editAntenna,
action: editAntenna,
},
];
/*
function focus() {
Expand Down
21 changes: 16 additions & 5 deletions packages/frontend/src/ui/deck/list-column.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,20 @@ async function setList() {
});
}
const menu = [{
icon: 'ti ti-pencil',
text: i18n.ts.selectList,
action: setList,
}];
function editList() {
os.pageWindow('my/lists/' + props.column.listId);
}
const menu = [
{
icon: 'ti ti-pencil',
text: i18n.ts.selectList,
action: setList,
},
{
icon: 'ti ti-settings',
text: i18n.ts.editList,
action: editList,
},
];
</script>

1 comment on commit b0cb4f0

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chromatic detects changes. Please review the changes on Chromatic.

Please sign in to comment.