mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-11-04 15:34:13 +00:00 
			
		
		
		
	enhance(frontend): クエリパラメータでuiを一時的に変更できるように (#15240)
* feat: クエリパラメータでuiを一時的に変更できるように * docs(changelog): クエリパラメータでuiを一時的に変更できるように * Update packages/frontend/src/boot/main-boot.ts Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> --------- Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									d7fdcbc733
								
							
						
					
					
						commit
						68175bc38d
					
				
					 2 changed files with 34 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -21,6 +21,7 @@
 | 
			
		|||
- Enhance: ノートの添付ファイルを一覧で遡れる「ファイル」タブを追加  
 | 
			
		||||
  (Based on https://github.com/Otaku-Social/maniakey/pull/14)
 | 
			
		||||
- Enhance: AiScriptの拡張API関数において引数の型チェックをより厳格に
 | 
			
		||||
- Enhance: クエリパラメータでuiを一時的に変更できるように #15240
 | 
			
		||||
- Fix: 画面サイズが変わった際にナビゲーションバーが自動で折りたたまれない問題を修正
 | 
			
		||||
- Fix: サーバー情報メニューに区切り線が不足していたのを修正
 | 
			
		||||
- Fix: ノートがログインしているユーザーしか見れない場合にログインダイアログを閉じるとその後の動線がなくなる問題を修正
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,6 +7,7 @@ import { createApp, defineAsyncComponent, markRaw } from 'vue';
 | 
			
		|||
import { ui } from '@@/js/config.js';
 | 
			
		||||
import { common } from './common.js';
 | 
			
		||||
import type * as Misskey from 'misskey-js';
 | 
			
		||||
import type { Component } from 'vue';
 | 
			
		||||
import { i18n } from '@/i18n.js';
 | 
			
		||||
import { alert, confirm, popup, post, toast } from '@/os.js';
 | 
			
		||||
import { useStream } from '@/stream.js';
 | 
			
		||||
| 
						 | 
				
			
			@ -25,13 +26,38 @@ import { type Keymap, makeHotkey } from '@/scripts/hotkey.js';
 | 
			
		|||
import { addCustomEmoji, removeCustomEmojis, updateCustomEmojis } from '@/custom-emojis.js';
 | 
			
		||||
 | 
			
		||||
export async function mainBoot() {
 | 
			
		||||
	const { isClientUpdated } = await common(() => createApp(
 | 
			
		||||
		new URLSearchParams(window.location.search).has('zen') || (ui === 'deck' && deckStore.state.useSimpleUiForNonRootPages && location.pathname !== '/') ? defineAsyncComponent(() => import('@/ui/zen.vue')) :
 | 
			
		||||
		!$i ? defineAsyncComponent(() => import('@/ui/visitor.vue')) :
 | 
			
		||||
		ui === 'deck' ? defineAsyncComponent(() => import('@/ui/deck.vue')) :
 | 
			
		||||
		ui === 'classic' ? defineAsyncComponent(() => import('@/ui/classic.vue')) :
 | 
			
		||||
		defineAsyncComponent(() => import('@/ui/universal.vue')),
 | 
			
		||||
	));
 | 
			
		||||
	const { isClientUpdated } = await common(() => {
 | 
			
		||||
		let uiStyle = ui;
 | 
			
		||||
		const searchParams = new URLSearchParams(window.location.search);
 | 
			
		||||
 | 
			
		||||
		if (!$i) uiStyle = 'visitor';
 | 
			
		||||
 | 
			
		||||
		if (searchParams.has('zen')) uiStyle = 'zen';
 | 
			
		||||
		if (uiStyle === 'deck' && deckStore.state.useSimpleUiForNonRootPages && location.pathname !== '/') uiStyle = 'zen';
 | 
			
		||||
 | 
			
		||||
		if (searchParams.has('ui')) uiStyle = searchParams.get('ui');
 | 
			
		||||
 | 
			
		||||
		let rootComponent: Component;
 | 
			
		||||
		switch (uiStyle) {
 | 
			
		||||
			case 'zen':
 | 
			
		||||
				rootComponent = defineAsyncComponent(() => import('@/ui/zen.vue'));
 | 
			
		||||
				break;
 | 
			
		||||
			case 'deck':
 | 
			
		||||
				rootComponent = defineAsyncComponent(() => import('@/ui/deck.vue'));
 | 
			
		||||
				break;
 | 
			
		||||
			case 'visitor':
 | 
			
		||||
				rootComponent = defineAsyncComponent(() => import('@/ui/visitor.vue'));
 | 
			
		||||
				break;
 | 
			
		||||
			case 'classic':
 | 
			
		||||
				rootComponent = defineAsyncComponent(() => import('@/ui/classic.vue'));
 | 
			
		||||
				break;
 | 
			
		||||
			default:
 | 
			
		||||
				rootComponent = defineAsyncComponent(() => import('@/ui/universal.vue'));
 | 
			
		||||
				break;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		return createApp(rootComponent);
 | 
			
		||||
	});
 | 
			
		||||
 | 
			
		||||
	reactionPicker.init();
 | 
			
		||||
	emojiPicker.init();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue