Initial commit: AI chat assistant with workflow chat, workspace, and profile tabs
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
67
components/WorkflowSelector.uvue
Normal file
67
components/WorkflowSelector.uvue
Normal file
@@ -0,0 +1,67 @@
|
||||
<template>
|
||||
<view class="workflow-selector">
|
||||
<view class="workflow-selector__scroll">
|
||||
<view class="workflow-selector__inner">
|
||||
<WorkflowChip
|
||||
v-for="wf in workflows"
|
||||
:key="wf.id"
|
||||
:workflow="wf"
|
||||
:active="wf.id === activeId"
|
||||
@tap="onSelectChip(wf.id)"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import type { WorkflowDef, WorkflowId } from '@/types/index'
|
||||
import WorkflowChip from './WorkflowChip.uvue'
|
||||
|
||||
const props = defineProps<{
|
||||
workflows: WorkflowDef[]
|
||||
activeId: WorkflowId
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
select: [id: WorkflowId]
|
||||
}>()
|
||||
|
||||
function onSelectChip(id: WorkflowId): void {
|
||||
if (id !== props.activeId) {
|
||||
emit('select', id)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.workflow-selector {
|
||||
padding: 8rpx 0;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* Outer: clips and scrolls */
|
||||
.workflow-selector__scroll {
|
||||
width: 100%;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
/* Inner: forced wider than screen, flex row, no wrap */
|
||||
.workflow-selector__inner {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
padding: 0 24rpx;
|
||||
width: max-content;
|
||||
min-width: 1100rpx;
|
||||
}
|
||||
|
||||
/* Hide scrollbar */
|
||||
.workflow-selector__scroll::-webkit-scrollbar {
|
||||
display: none;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user