Skip to content

Commit 4764440

Browse files
committed
Refactor configurations footer landscape placeholder styles and remove unused api call cancellation handler
- use 'is landscape' in `packages/ui/src/components/editor/prompt/Configurations/Configurations.tsx` and use it for [Fragment] - use css mixin instad of [Fragment] ├── apps │ └── editor │ └── src │ └── views │ └── prompt │ └── frontend │ ├── Home │ │ ├── Home.module.scss │ │ └── Home.tsx │ ├── Main │ │ └── MainView │ │ ├── MainView.module.scss │ │ ├── MainView.tsx │ │ └── components │ │ └── Header │ │ ├── Header.module.scss │ │ └── Header.tsx │ └── hooks │ └── use-is-landscape.ts └── packages └── ui └── src └── components └── editor └── prompt └── Configurations ├── Configurations.module.scss └── Configurations.tsx
1 parent f1c5c78 commit 4764440

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

‎apps/editor/src/views/prompt/backend/prompt-view-provider.ts‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -688,10 +688,6 @@ export class PromptViewProvider implements vscode.WebviewViewProvider {
688688
this.api_call_abort_controller.abort('Cancelled by user.')
689689
this.api_call_abort_controller = null
690690
}
691-
} else if (
692-
message.command == 'CANCEL_PROMPT_VIEW_API_CALLS_MANAGER_REQUEST'
693-
) {
694-
this.prompt_view_api_calls_manager.cancel_api_call(message.id)
695691
} else if (message.command == 'GET_API_CONFIGURATIONS') {
696692
await handle_get_api_configurations(this)
697693
} else if (message.command == 'REORDER_API_CONFIGURATIONS') {

‎packages/ui/src/components/editor/prompt/Configurations/Configurations.module.scss‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,4 +142,14 @@
142142
> button {
143143
flex: 1;
144144
}
145+
146+
&--landscape-placeholder {
147+
display: none;
148+
visibility: hidden;
149+
pointer-events: none;
150+
151+
@include landscape {
152+
display: flex;
153+
}
154+
}
145155
}

‎packages/ui/src/components/editor/prompt/Configurations/Configurations.tsx‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ export const Configurations: React.FC<Configurations.Props> = (props) => {
142142
<div className={styles.container}>
143143
{props.configurations.length == 0 && (
144144
<div
145-
className={styles.footer}
146-
style={{ visibility: 'hidden', pointerEvents: 'none' }}
145+
className={cn(styles.footer, styles['footer--landscape-placeholder'])}
147146
>
148147
<Button>{props.translations.add_new}</Button>
149148
</div>

0 commit comments

Comments
 (0)