improvement(chat): code-split resource preview panel out of initial /chat bundle by waleedlatif1 · Pull Request #5331 · simstudioai/sim · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .claude/rules/sim-imports.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export {
MothershipResourcesProvider,
useMothershipResources,
} from './mothership-resources-context'
export { MothershipView } from './mothership-view'
export { QueuedMessages } from './queued-messages'
export { SuggestedActions } from './suggested-actions'
export { UserInput, type UserInputHandle } from './user-input'
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ export function PromptEditor({
return <span>{displayText}</span>
}

const contextByLabel = new Map<string, (typeof contexts)[number]>()
for (const c of contexts) {
if (!contextByLabel.has(c.label)) contextByLabel.set(c.label, c)
}

const elements: React.ReactNode[] = []
let lastIndex = 0
for (let i = 0; i < ranges.length; i++) {
Expand All @@ -133,7 +138,7 @@ export function PromptEditor({
}

const mentionLabel = stripMentionTrigger(range.token)
const matchingCtx = contexts.find((c) => c.label === mentionLabel)
const matchingCtx = contextByLabel.get(mentionLabel)

const mentionIconNode = matchingCtx ? (
<ContextMentionIcon
Expand Down
40 changes: 27 additions & 13 deletions apps/sim/app/workspace/[workspaceId]/home/home.tsx
Loading