Merge branch 'notification-read-api' into swn

This commit is contained in:
tamaina 2021-12-25 23:03:53 +09:00
commit 67ecd704f7
20 changed files with 20 additions and 166 deletions

View File

@ -13,6 +13,7 @@
## 12.x.x (unreleased) ## 12.x.x (unreleased)
### Improvements ### Improvements
- クライアント: ノートプレビューの精度を改善
### Bugfixes ### Bugfixes
- クライアント: 一部のコンポーネントが裏に隠れるのを修正 - クライアント: 一部のコンポーネントが裏に隠れるのを修正

View File

@ -7,7 +7,7 @@
</div> </div>
<div class="body"> <div class="body">
<div class="content"> <div class="content">
<Mfm :text="text" :author="$i" :i="$i"/> <Mfm :text="text.trim()" :author="$i" :i="$i"/>
</div> </div>
</div> </div>
</div> </div>
@ -61,6 +61,7 @@ export default defineComponent({
width: 40px; width: 40px;
height: 40px; height: 40px;
border-radius: 8px; border-radius: 8px;
pointer-events: none;
} }
> .main { > .main {
@ -69,6 +70,7 @@ export default defineComponent({
> .header { > .header {
margin-bottom: 2px; margin-bottom: 2px;
font-weight: bold;
} }
> .body { > .body {

View File

@ -40,7 +40,6 @@ import MkButton from '@/components/ui/button.vue';
import MkSwitch from '@/components/form/switch.vue'; import MkSwitch from '@/components/form/switch.vue';
import XModalWindow from '@/components/ui/modal-window.vue'; import XModalWindow from '@/components/ui/modal-window.vue';
import MkDriveFileThumbnail from '@/components/drive-file-thumbnail.vue'; import MkDriveFileThumbnail from '@/components/drive-file-thumbnail.vue';
import Progress from '@/scripts/loading';
import bytes from '@/filters/bytes'; import bytes from '@/filters/bytes';
import * as os from '@/os'; import * as os from '@/os';
@ -74,11 +73,9 @@ export default defineComponent({
methods: { methods: {
async fetch() { async fetch() {
Progress.start();
this.file = await os.api('drive/files/show', { fileId: this.fileId }); this.file = await os.api('drive/files/show', { fileId: this.fileId });
this.info = await os.api('admin/drive/show-file', { fileId: this.fileId }); this.info = await os.api('admin/drive/show-file', { fileId: this.fileId });
this.isSensitive = this.file.isSensitive; this.isSensitive = this.file.isSensitive;
Progress.done();
}, },
showUser() { showUser() {

View File

@ -7,8 +7,6 @@
src="antenna" src="antenna"
:antenna="antennaId" :antenna="antennaId"
:sound="true" :sound="true"
@before="before()"
@after="after()"
@queue="queueUpdated" @queue="queueUpdated"
/> />
</div> </div>
@ -17,7 +15,6 @@
<script lang="ts"> <script lang="ts">
import { defineComponent, defineAsyncComponent, computed } from 'vue'; import { defineComponent, defineAsyncComponent, computed } from 'vue';
import Progress from '@/scripts/loading';
import XTimeline from '@/components/timeline.vue'; import XTimeline from '@/components/timeline.vue';
import { scroll } from '@/scripts/scroll'; import { scroll } from '@/scripts/scroll';
import * as os from '@/os'; import * as os from '@/os';
@ -76,14 +73,6 @@ export default defineComponent({
}, },
methods: { methods: {
before() {
Progress.start();
},
after() {
Progress.done();
},
queueUpdated(q) { queueUpdated(q) {
this.queue = q; this.queue = q;
}, },

View File

@ -1,14 +1,13 @@
<template> <template>
<div class="jmelgwjh"> <div class="jmelgwjh">
<div class="body"> <div class="body">
<XNotes class="notes" :pagination="pagination" :detail="true" :prop="'note'" @before="before()" @after="after()"/> <XNotes class="notes" :pagination="pagination" :detail="true" :prop="'note'"/>
</div> </div>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
import Progress from '@/scripts/loading';
import XNotes from '@/components/notes.vue'; import XNotes from '@/components/notes.vue';
import * as os from '@/os'; import * as os from '@/os';
import * as symbols from '@/symbols'; import * as symbols from '@/symbols';
@ -33,16 +32,6 @@ export default defineComponent({
}, },
}; };
}, },
methods: {
before() {
Progress.start();
},
after() {
Progress.done();
}
}
}); });
</script> </script>

View File

@ -1,12 +1,11 @@
<template> <template>
<MkSpacer :content-max="800"> <MkSpacer :content-max="800">
<XNotes ref="notes" :pagination="pagination" @before="before" @after="after"/> <XNotes ref="notes" :pagination="pagination"/>
</MkSpacer> </MkSpacer>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
import Progress from '@/scripts/loading';
import XNotes from '@/components/notes.vue'; import XNotes from '@/components/notes.vue';
import * as symbols from '@/symbols'; import * as symbols from '@/symbols';
@ -29,15 +28,5 @@ export default defineComponent({
}, },
}; };
}, },
methods: {
before() {
Progress.start();
},
after() {
Progress.done();
}
}
}); });
</script> </script>

View File

@ -1,12 +1,11 @@
<template> <template>
<MkSpacer :content-max="800"> <MkSpacer :content-max="800">
<XNotes :pagination="pagination" @before="before()" @after="after()"/> <XNotes :pagination="pagination"/>
</MkSpacer> </MkSpacer>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
import Progress from '@/scripts/loading';
import XNotes from '@/components/notes.vue'; import XNotes from '@/components/notes.vue';
import * as symbols from '@/symbols'; import * as symbols from '@/symbols';
@ -28,15 +27,5 @@ export default defineComponent({
}, },
}; };
}, },
methods: {
before() {
Progress.start();
},
after() {
Progress.done();
}
}
}); });
</script> </script>

View File

@ -1,12 +1,11 @@
<template> <template>
<MkSpacer :content-max="800"> <MkSpacer :content-max="800">
<XNotes :pagination="pagination" @before="before()" @after="after()"/> <XNotes :pagination="pagination"/>
</MkSpacer> </MkSpacer>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
import Progress from '@/scripts/loading';
import XNotes from '@/components/notes.vue'; import XNotes from '@/components/notes.vue';
import * as symbols from '@/symbols'; import * as symbols from '@/symbols';
@ -31,15 +30,5 @@ export default defineComponent({
}, },
}; };
}, },
methods: {
before() {
Progress.start();
},
after() {
Progress.done();
}
}
}); });
</script> </script>

View File

@ -35,7 +35,6 @@
<script lang="ts"> <script lang="ts">
import { computed, defineComponent } from 'vue'; import { computed, defineComponent } from 'vue';
import Progress from '@/scripts/loading';
import MkButton from '@/components/ui/button.vue'; import MkButton from '@/components/ui/button.vue';
import * as os from '@/os'; import * as os from '@/os';
import * as symbols from '@/symbols'; import * as symbols from '@/symbols';
@ -73,7 +72,6 @@ export default defineComponent({
methods: { methods: {
fetch() { fetch() {
Progress.start();
os.api('users/groups/show', { os.api('users/groups/show', {
groupId: this.groupId groupId: this.groupId
}).then(group => { }).then(group => {
@ -82,7 +80,6 @@ export default defineComponent({
userIds: this.group.userIds userIds: this.group.userIds
}).then(users => { }).then(users => {
this.users = users; this.users = users;
Progress.done();
}); });
}); });
}, },

View File

@ -36,7 +36,6 @@
<script lang="ts"> <script lang="ts">
import { computed, defineComponent } from 'vue'; import { computed, defineComponent } from 'vue';
import Progress from '@/scripts/loading';
import MkButton from '@/components/ui/button.vue'; import MkButton from '@/components/ui/button.vue';
import * as os from '@/os'; import * as os from '@/os';
import * as symbols from '@/symbols'; import * as symbols from '@/symbols';
@ -68,7 +67,6 @@ export default defineComponent({
methods: { methods: {
fetch() { fetch() {
Progress.start();
os.api('users/lists/show', { os.api('users/lists/show', {
listId: this.$route.params.list listId: this.$route.params.list
}).then(list => { }).then(list => {
@ -77,7 +75,6 @@ export default defineComponent({
userIds: this.list.userIds userIds: this.list.userIds
}).then(users => { }).then(users => {
this.users = users; this.users = users;
Progress.done();
}); });
}); });
}, },

View File

@ -1,14 +1,13 @@
<template> <template>
<MkSpacer :content-max="800"> <MkSpacer :content-max="800">
<div class="clupoqwt"> <div class="clupoqwt">
<XNotifications class="notifications" :include-types="includeTypes" :unread-only="tab === 'unread'" @before="before" @after="after"/> <XNotifications class="notifications" :include-types="includeTypes" :unread-only="tab === 'unread'"/>
</div> </div>
</MkSpacer> </MkSpacer>
</template> </template>
<script lang="ts"> <script lang="ts">
import { computed, defineComponent } from 'vue'; import { computed, defineComponent } from 'vue';
import Progress from '@/scripts/loading';
import XNotifications from '@/components/notifications.vue'; import XNotifications from '@/components/notifications.vue';
import * as os from '@/os'; import * as os from '@/os';
import * as symbols from '@/symbols'; import * as symbols from '@/symbols';
@ -53,14 +52,6 @@ export default defineComponent({
}, },
methods: { methods: {
before() {
Progress.start();
},
after() {
Progress.done();
},
setFilter(ev) { setFilter(ev) {
const typeItems = notificationTypes.map(t => ({ const typeItems = notificationTypes.map(t => ({
text: this.$t(`_notification._types.${t}`), text: this.$t(`_notification._types.${t}`),

View File

@ -1,14 +1,13 @@
<template> <template>
<div class="_section"> <div class="_section">
<div class="_content"> <div class="_content">
<XNotes ref="notes" :pagination="pagination" @before="before" @after="after"/> <XNotes ref="notes" :pagination="pagination"/>
</div> </div>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { computed, defineComponent } from 'vue'; import { computed, defineComponent } from 'vue';
import Progress from '@/scripts/loading';
import XNotes from '@/components/notes.vue'; import XNotes from '@/components/notes.vue';
import * as symbols from '@/symbols'; import * as symbols from '@/symbols';
@ -39,15 +38,5 @@ export default defineComponent({
(this.$refs.notes as any).reload(); (this.$refs.notes as any).reload();
} }
}, },
methods: {
before() {
Progress.start();
},
after() {
Progress.done();
}
}
}); });
</script> </script>

View File

@ -1,12 +1,11 @@
<template> <template>
<div class="_section"> <div class="_section">
<XNotes ref="notes" class="_content" :pagination="pagination" @before="before" @after="after"/> <XNotes ref="notes" class="_content" :pagination="pagination"/>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
import Progress from '@/scripts/loading';
import XNotes from '@/components/notes.vue'; import XNotes from '@/components/notes.vue';
import * as symbols from '@/symbols'; import * as symbols from '@/symbols';
@ -43,15 +42,5 @@ export default defineComponent({
(this.$refs.notes as any).reload(); (this.$refs.notes as any).reload();
} }
}, },
methods: {
before() {
Progress.start();
},
after() {
Progress.done();
}
}
}); });
</script> </script>

View File

@ -10,8 +10,6 @@
class="tl" class="tl"
:src="src" :src="src"
:sound="true" :sound="true"
@before="before()"
@after="after()"
@queue="queueUpdated" @queue="queueUpdated"
/> />
</div> </div>
@ -21,7 +19,6 @@
<script lang="ts"> <script lang="ts">
import { defineComponent, defineAsyncComponent, computed } from 'vue'; import { defineComponent, defineAsyncComponent, computed } from 'vue';
import Progress from '@/scripts/loading';
import XTimeline from '@/components/timeline.vue'; import XTimeline from '@/components/timeline.vue';
import XPostForm from '@/components/post-form.vue'; import XPostForm from '@/components/post-form.vue';
import { scroll } from '@/scripts/scroll'; import { scroll } from '@/scripts/scroll';
@ -118,14 +115,6 @@ export default defineComponent({
}, },
methods: { methods: {
before() {
Progress.start();
},
after() {
Progress.done();
},
queueUpdated(q) { queueUpdated(q) {
this.queue = q; this.queue = q;
}, },

View File

@ -7,8 +7,6 @@
src="list" src="list"
:list="listId" :list="listId"
:sound="true" :sound="true"
@before="before()"
@after="after()"
@queue="queueUpdated" @queue="queueUpdated"
/> />
</div> </div>
@ -17,7 +15,6 @@
<script lang="ts"> <script lang="ts">
import { defineComponent, defineAsyncComponent, computed } from 'vue'; import { defineComponent, defineAsyncComponent, computed } from 'vue';
import Progress from '@/scripts/loading';
import XTimeline from '@/components/timeline.vue'; import XTimeline from '@/components/timeline.vue';
import { scroll } from '@/scripts/scroll'; import { scroll } from '@/scripts/scroll';
import * as os from '@/os'; import * as os from '@/os';
@ -76,14 +73,6 @@ export default defineComponent({
}, },
methods: { methods: {
before() {
Progress.start();
},
after() {
Progress.done();
},
queueUpdated(q) { queueUpdated(q) {
this.queue = q; this.queue = q;
}, },

View File

@ -205,7 +205,6 @@ import MkFolder from '@/components/ui/folder.vue';
import MkRemoteCaution from '@/components/remote-caution.vue'; import MkRemoteCaution from '@/components/remote-caution.vue';
import MkTab from '@/components/tab.vue'; import MkTab from '@/components/tab.vue';
import MkInfo from '@/components/ui/info.vue'; import MkInfo from '@/components/ui/info.vue';
import Progress from '@/scripts/loading';
import * as Acct from 'misskey-js/built/acct'; import * as Acct from 'misskey-js/built/acct';
import { getScrollPosition } from '@/scripts/scroll'; import { getScrollPosition } from '@/scripts/scroll';
import { getUserMenu } from '@/scripts/get-user-menu'; import { getUserMenu } from '@/scripts/get-user-menu';
@ -328,13 +327,10 @@ export default defineComponent({
fetch() { fetch() {
if (this.acct == null) return; if (this.acct == null) return;
this.user = null; this.user = null;
Progress.start();
os.api('users/show', Acct.parse(this.acct)).then(user => { os.api('users/show', Acct.parse(this.acct)).then(user => {
this.user = user; this.user = user;
}).catch(e => { }).catch(e => {
this.error = e; this.error = e;
}).finally(() => {
Progress.done();
}); });
}, },

View File

@ -1,11 +0,0 @@
export default {
start: () => {
// TODO
},
done: () => {
// TODO
},
set: val => {
// TODO
}
};

View File

@ -170,6 +170,8 @@ export default defineComponent({
} }
&:hover, &.active { &:hover, &.active {
color: var(--accent);
&:before { &:before {
content: ""; content: "";
display: block; display: block;
@ -283,8 +285,10 @@ export default defineComponent({
} }
&:before { &:before {
width: 100%; width: auto;
border-radius: 0; height: 100%;
aspect-ratio: 1/1;
border-radius: 8px;
} }
&.post { &.post {
@ -296,8 +300,9 @@ export default defineComponent({
} }
&.post:before { &.post:before {
width: calc(100% - 32px); width: calc(100% - 28px);
height: calc(100% - 32px); height: auto;
aspect-ratio: 1/1;
border-radius: 100%; border-radius: 100%;
} }
} }

View File

@ -8,7 +8,6 @@
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
import Progress from '@/scripts/loading';
import XColumn from './column.vue'; import XColumn from './column.vue';
import XNotes from '@/components/notes.vue'; import XNotes from '@/components/notes.vue';
import * as os from '@/os'; import * as os from '@/os';
@ -41,15 +40,5 @@ export default defineComponent({
}, },
} }
}, },
methods: {
before() {
Progress.start();
},
after() {
Progress.done();
}
}
}); });
</script> </script>

View File

@ -8,7 +8,6 @@
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
import Progress from '@/scripts/loading';
import XColumn from './column.vue'; import XColumn from './column.vue';
import XNotes from '@/components/notes.vue'; import XNotes from '@/components/notes.vue';
import * as os from '@/os'; import * as os from '@/os';
@ -38,15 +37,5 @@ export default defineComponent({
}, },
} }
}, },
methods: {
before() {
Progress.start();
},
after() {
Progress.done();
}
}
}); });
</script> </script>