diff --git a/migration/1613503367223-use-bigint-for-driveUsage.ts b/migration/1613503367223-use-bigint-for-driveUsage.ts new file mode 100644 index 0000000000..d04e817ec5 --- /dev/null +++ b/migration/1613503367223-use-bigint-for-driveUsage.ts @@ -0,0 +1,15 @@ +import {MigrationInterface, QueryRunner} from "typeorm"; + +export class useBigintForDriveUsage1613503367223 implements MigrationInterface { + name = 'useBigintForDriveUsage1613503367223' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "instance" ALTER COLUMN "driveUsage" TYPE bigint`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "driveUsage"`); + await queryRunner.query(`ALTER TABLE "instance" ADD "driveUsage" integer NOT NULL DEFAULT 0`); + } + +} diff --git a/src/client/account.ts b/src/client/account.ts index 1ba7a28908..80af931f46 100644 --- a/src/client/account.ts +++ b/src/client/account.ts @@ -3,7 +3,6 @@ import { reactive } from 'vue'; import { apiUrl } from '@/config'; import { waiting } from '@/os'; import { unisonReload, reloadChannel } from '@/scripts/unison-reload'; - // TODO: 他のタブと永続化されたstateを同期 type Account = { diff --git a/src/client/components/emoji-picker.vue b/src/client/components/emoji-picker.vue index c2d1008e1b..9a261ef83f 100644 --- a/src/client/components/emoji-picker.vue +++ b/src/client/components/emoji-picker.vue @@ -99,7 +99,8 @@ import { faHeart, faFlag, faLaugh } from '@fortawesome/free-regular-svg-icons'; import MkModal from '@/components/ui/modal.vue'; import Particle from '@/components/particle.vue'; import * as os from '@/os'; -import { isDeviceTouch } from '../scripts/is-device-touch'; +import { isDeviceTouch } from '@/scripts/is-device-touch'; +import { isMobile } from '@/scripts/is-mobile'; import { emojiCategories } from '@/instance'; export default defineComponent({ @@ -322,7 +323,7 @@ export default defineComponent({ }, mounted() { - if (!os.isMobile) { + if (!isMobile && !isDeviceTouch) { this.$refs.search.focus({ preventScroll: true }); diff --git a/src/client/components/post-form.vue b/src/client/components/post-form.vue index e23d074a96..d60af57f54 100644 --- a/src/client/components/post-form.vue +++ b/src/client/components/post-form.vue @@ -69,6 +69,7 @@ import { noteVisibilities } from '../../types'; import * as os from '@/os'; import { selectFile } from '@/scripts/select-file'; import { notePostInterruptors, postFormActions } from '@/store'; +import { isMobile } from '@/scripts/is-mobile'; export default defineComponent({ components: { @@ -580,7 +581,7 @@ export default defineComponent({ localOnly: this.localOnly, visibility: this.visibility, visibleUserIds: this.visibility == 'specified' ? this.visibleUsers.map(u => u.id) : undefined, - viaMobile: os.isMobile + viaMobile: isMobile }; // plugin diff --git a/src/client/components/sidebar.vue b/src/client/components/sidebar.vue index 6561a61356..8eace36f19 100644 --- a/src/client/components/sidebar.vue +++ b/src/client/components/sidebar.vue @@ -138,13 +138,19 @@ export default defineComponent({ }, async openAccountMenu(ev) { - const storedAccounts = await getAccounts(); - const accounts = (await os.api('users/show', { userIds: storedAccounts.map(x => x.id) })).filter(x => x.id !== this.$i.id); + const storedAccounts = (await getAccounts()).filter(x => x.id !== this.$i.id); + const accountsPromise = os.api('users/show', { userIds: storedAccounts.map(x => x.id) }); - const accountItems = accounts.map(account => ({ - type: 'user', - user: account, - action: () => { this.switchAccount(account); } + const accountItemPromises = storedAccounts.map(a => new Promise(res => { + accountsPromise.then(accounts => { + const account = accounts.find(x => x.id === a.id); + if (account == null) return res(null); + res({ + type: 'user', + user: account, + action: () => { this.switchAccount(account); } + }); + }); })); os.modalMenu([...[{ @@ -152,7 +158,7 @@ export default defineComponent({ text: this.$ts.profile, to: `/@${ this.$i.username }`, avatar: this.$i, - }, null, ...accountItems, { + }, null, ...accountItemPromises, { icon: faPlus, text: this.$ts.addAcount, action: () => { diff --git a/src/client/init.ts b/src/client/init.ts index 27cca0eb42..264ecaf8d1 100644 --- a/src/client/init.ts +++ b/src/client/init.ts @@ -56,13 +56,14 @@ import { router } from '@/router'; import { applyTheme } from '@/scripts/theme'; import { isDeviceDarkmode } from '@/scripts/is-device-darkmode'; import { i18n } from '@/i18n'; -import { stream, isMobile, dialog, post } from '@/os'; +import { stream, dialog, post } from '@/os'; import * as sound from '@/scripts/sound'; import { $i, refreshAccount, login, updateAccount, signout } from '@/account'; import { defaultStore, ColdDeviceStorage } from '@/store'; import { fetchInstance, instance } from '@/instance'; import { makeHotkey } from '@/scripts/hotkey'; import { search } from '@/scripts/search'; +import { isMobile } from '@/scripts/is-mobile'; import { getThemes } from '@/theme-store'; import { initializeSw } from '@/scripts/initialize-sw'; import { reloadChannel } from '@/scripts/unison-reload'; diff --git a/src/client/os.ts b/src/client/os.ts index 95dcd3eb65..59ee3617e1 100644 --- a/src/client/os.ts +++ b/src/client/os.ts @@ -9,9 +9,6 @@ import { resolve } from '@/router'; import { $i } from '@/account'; import { defaultStore } from '@/store'; -const ua = navigator.userAgent.toLowerCase(); -export const isMobile = /mobile|iphone|ipad|android/.test(ua); - export const stream = markRaw(new Stream()); export const pendingApiRequestsCount = ref(0); diff --git a/src/client/scripts/is-mobile.ts b/src/client/scripts/is-mobile.ts new file mode 100644 index 0000000000..60cb59f91e --- /dev/null +++ b/src/client/scripts/is-mobile.ts @@ -0,0 +1,2 @@ +const ua = navigator.userAgent.toLowerCase(); +export const isMobile = /mobile|iphone|ipad|android/.test(ua); diff --git a/src/client/themes/_dark.json5 b/src/client/themes/_dark.json5 index 847c0b4ec4..2fa4853e6f 100644 --- a/src/client/themes/_dark.json5 +++ b/src/client/themes/_dark.json5 @@ -16,6 +16,8 @@ bg: '#000', acrylicBg: ':alpha<0.5<@bg', fg: '#dadada', + fgTransparentWeak: ':alpha<0.75<@fg', + fgTransparent: ':alpha<0.5<@fg', fgHighlighted: ':lighten<3<@fg', divider: 'rgba(255, 255, 255, 0.1)', indicator: '@accent', @@ -77,5 +79,6 @@ X14: ':alpha<0.5<@navBg', X15: ':alpha<0<@panel', X16: ':alpha<0.7<@panel', + X17: ':alpha<0.8<@bg', }, } diff --git a/src/client/themes/_light.json5 b/src/client/themes/_light.json5 index d75e94afd6..94e6977502 100644 --- a/src/client/themes/_light.json5 +++ b/src/client/themes/_light.json5 @@ -16,6 +16,8 @@ bg: '#fff', acrylicBg: ':alpha<0.5<@bg', fg: '#5f5f5f', + fgTransparentWeak: ':alpha<0.75<@fg', + fgTransparent: ':alpha<0.5<@fg', fgHighlighted: ':darken<3<@fg', divider: 'rgba(0, 0, 0, 0.1)', indicator: '@accent', @@ -77,5 +79,6 @@ X14: ':alpha<0.5<@navBg', X15: ':alpha<0<@panel', X16: ':alpha<0.7<@panel', + X17: ':alpha<0.8<@bg', }, } diff --git a/src/client/ui/chat/index.vue b/src/client/ui/chat/index.vue index e8cda62742..79c0d53074 100644 --- a/src/client/ui/chat/index.vue +++ b/src/client/ui/chat/index.vue @@ -200,6 +200,11 @@ export default defineComponent({ }, created() { + if (window.innerWidth < 1024) { + localStorage.setItem('ui', 'default'); + location.reload(); + } + router.beforeEach((to, from) => { this.$refs.side.navigate(to.fullPath); // search?q=foo のようなクエリを受け取れるようにするため、return falseはできない @@ -414,10 +419,12 @@ export default defineComponent({ > .body { flex: 1; min-width: 0; - padding: 8px 0; overflow: auto; > .container { + margin-top: 8px; + margin-bottom: 8px; + & + .container { margin-top: 16px; } @@ -426,10 +433,21 @@ export default defineComponent({ display: flex; font-size: 0.9em; padding: 8px 16px; - opacity: 0.7; + position: sticky; + top: 0; + background: var(--X17); + -webkit-backdrop-filter: blur(8px); + backdrop-filter: blur(8px); + z-index: 1; + color: var(--fgTransparentWeak); > .add { margin-left: auto; + color: var(--fgTransparentWeak); + + &:hover { + color: var(--fg); + } } } @@ -448,11 +466,11 @@ export default defineComponent({ &.active, &.active:hover { background: var(--accent); - color: #fff; + color: #fff !important; } &.read { - opacity: 0.5; + color: var(--fgTransparent); } > .icon { @@ -527,6 +545,7 @@ export default defineComponent({ > .instance { margin-right: 16px; + font-size: 0.9em; } > .clock { diff --git a/src/client/ui/chat/note.vue b/src/client/ui/chat/note.vue index 11d795d93e..f4c9f063dc 100644 --- a/src/client/ui/chat/note.vue +++ b/src/client/ui/chat/note.vue @@ -65,21 +65,21 @@