chore: exclude local resource artifacts from main sync
This commit is contained in:
44
src/views/play/LayoutPlaygroundView.tsx
Executable file → Normal file
44
src/views/play/LayoutPlaygroundView.tsx
Executable file → Normal file
@@ -24,14 +24,12 @@ import { componentSampleEntries, widgetSampleEntries } from '../../app/manifests
|
||||
import { createChatConversationRoom, fetchChatConversations } from '../../app/main/mainChatPanel';
|
||||
import { resolveChatWebSocketUrl } from '../../app/main/mainChatPanel/chatUtils';
|
||||
import { buildChatPath } from '../../app/main/routes';
|
||||
import { LAYOUT_EDITOR_CHAT_TYPE_NAME } from '../../app/main/chatTypeDefaults';
|
||||
import { canUseChatType, resolveCurrentChatPermissionRoles, useChatTypeRegistry } from '../../app/main/chatTypeAccess';
|
||||
import { useTokenAccess } from '../../app/main/tokenAccess';
|
||||
import type { SelectOptionItem } from '../../components/inputs/select';
|
||||
import { StockAlertFilterPane, StockAlertGridPane, StockAlertLayoutProvider } from '../../features/layout/stock-alert';
|
||||
import { resolveSampleEntries, type LoadedSampleEntry } from '../../samples/registry';
|
||||
import { deleteLayout, listSavedLayouts, saveLayout, type LayoutAxis as StoredLayoutAxis, type SavedLayoutRecord, type SizeUnit as StoredSizeUnit } from './layoutStorage';
|
||||
import { resolvePreferredLayoutCodexChatType } from './layoutCodexChatType';
|
||||
import {
|
||||
LayoutPreviewActionPane,
|
||||
LayoutPreviewBaseInputPane,
|
||||
@@ -758,7 +756,7 @@ function resolveLayoutCodexRequestSocketUrl(sessionId: string) {
|
||||
|
||||
if (['127.0.0.1', 'localhost', '0.0.0.0'].includes(window.location.hostname)) {
|
||||
resolvedUrl.protocol = 'wss:';
|
||||
resolvedUrl.hostname = 'test.sm-home.cloud';
|
||||
resolvedUrl.hostname = 'preview.sm-home.cloud';
|
||||
resolvedUrl.port = '';
|
||||
resolvedUrl.pathname = '/ws/chat';
|
||||
}
|
||||
@@ -888,11 +886,25 @@ export function LayoutPlaygroundView({
|
||||
() => chatTypes.filter((item) => canUseChatType(item, chatPermissionRoles)),
|
||||
[chatPermissionRoles, chatTypes],
|
||||
);
|
||||
const preferredCodexChatType = useMemo(
|
||||
() => resolvePreferredLayoutCodexChatType(availableChatTypes),
|
||||
[availableChatTypes],
|
||||
const [selectedCodexChatTypeId, setSelectedCodexChatTypeId] = useState<string | null>(null);
|
||||
const selectedCodexChatType = useMemo(
|
||||
() => availableChatTypes.find((item) => item.id === selectedCodexChatTypeId) ?? availableChatTypes[0] ?? null,
|
||||
[availableChatTypes, selectedCodexChatTypeId],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (availableChatTypes.length === 0) {
|
||||
setSelectedCodexChatTypeId(null);
|
||||
return;
|
||||
}
|
||||
|
||||
if (selectedCodexChatTypeId && availableChatTypes.some((item) => item.id === selectedCodexChatTypeId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
setSelectedCodexChatTypeId(availableChatTypes[0]?.id ?? null);
|
||||
}, [availableChatTypes, selectedCodexChatTypeId]);
|
||||
|
||||
const createLeafNode = (): LayoutLeafNode => {
|
||||
const preset = LEAF_PRESETS[leafPresetRef.current % LEAF_PRESETS.length];
|
||||
leafPresetRef.current += 1;
|
||||
@@ -1322,7 +1334,7 @@ export function LayoutPlaygroundView({
|
||||
}
|
||||
|
||||
const text = prompt.trim();
|
||||
const chatType = preferredCodexChatType;
|
||||
const chatType = selectedCodexChatType;
|
||||
const conversationTitle = resolveLayoutConversationTitle(layoutName);
|
||||
|
||||
if (!text) {
|
||||
@@ -3024,8 +3036,21 @@ export function LayoutPlaygroundView({
|
||||
현재 편집 결과와 기능 명세 항목을 함께 저장합니다.
|
||||
</Paragraph>
|
||||
<Text type="secondary" className="layout-playground__codex-chat-type-copy">
|
||||
Codex 실행 유형: <Tag color="cyan">{preferredCodexChatType?.name ?? LAYOUT_EDITOR_CHAT_TYPE_NAME}</Tag>
|
||||
Codex 실행 유형
|
||||
</Text>
|
||||
<Select
|
||||
size="small"
|
||||
value={selectedCodexChatType?.id ?? undefined}
|
||||
placeholder="채팅유형 선택"
|
||||
className="layout-playground__codex-chat-type-select"
|
||||
options={availableChatTypes.map((item) => ({
|
||||
value: item.id,
|
||||
label: item.name,
|
||||
}))}
|
||||
onChange={(nextValue) => {
|
||||
setSelectedCodexChatTypeId(nextValue);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="layout-playground__bottom-menu-actions">
|
||||
<Tag color={isSavedLayoutReadyForCodex ? 'blue' : 'warning'}>
|
||||
@@ -3051,6 +3076,7 @@ export function LayoutPlaygroundView({
|
||||
type="primary"
|
||||
icon={<MessageOutlined />}
|
||||
loading={isSaving}
|
||||
disabled={!selectedCodexChatType}
|
||||
onClick={() => void handleSaveLayout({ openCodexAfterSave: true })}
|
||||
>
|
||||
저장 후 Codex 요청
|
||||
@@ -3058,7 +3084,7 @@ export function LayoutPlaygroundView({
|
||||
<Button
|
||||
ghost
|
||||
icon={<MessageOutlined />}
|
||||
disabled={!hasCurrentPrompt || !isSavedLayoutReadyForCodex}
|
||||
disabled={!hasCurrentPrompt || !isSavedLayoutReadyForCodex || !selectedCodexChatType}
|
||||
onClick={() => {
|
||||
openCodexLiveForPrompt(currentInteractionPrompt);
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user