Waleed 6806fc2f41 fix(resources): sort folders and resources as one list so pinned items reach the top (#6213)
* fix(resources): stop hoisting folders so pinned items reach the top

Folders and their sibling resources were sorted as two lists and
concatenated folders-first, so a pinned file, table, or knowledge base
could never rank above an unpinned folder — pinning only reordered
within each partition.

Sort them as one list instead: pinned -> sort key -> name, in a shared
`sortResources` comparator. Rows with no value for the active column
(a folder has no row count or token count) sort last in both
directions, and the name tiebreak is never inverted by `desc`.

Also aligns the surfaces that browse the same resources: the mothership
resource trees, the collapsed sidebar flyout (whose nested levels
partitioned folders-first while its own root interleaved), the sidebar
file tree, and the recently-deleted tiebreak.

Files' sort params were nullable only to encode "folders name/asc,
files updated/desc"; with one list that state is gone, so they default
to updated/desc like Tables and Knowledge.

* improvement(resources): prefetch pinned ids and members with the resource lists

Files, Tables, and Knowledge already prefetched their items and folders,
but not the two lists a complete row needs.

Pinned ids are the list's primary sort key now, so a page that painted
before they arrived rendered the whole list in the wrong order and then
visibly re-sorted. Members back the Owner column, which painted empty
and filled in after.

Both now hydrate alongside the lists via `prefetchResourceListChrome`.
Pinned keys move to `hooks/queries/utils/pinned-item-keys` so the server
prefetch can address them without pulling the contracts barrel and the
optimistic-mutation machinery into the route.

* chore(knowledge): drop the dead pre-redesign knowledge base sort

`sortKnowledgeBases` was a second, complete ordering for knowledge bases
(name/createdAt/updatedAt/docCount) left over from the old sort dropdown,
with no consumers since the shared Resource sort menu replaced it — the
kind of duplicate that silently diverges from the page it shadows.

Its `SortOption`/`SortOrder` types and the `SORT_OPTIONS` list that fed
it were dead with it. `utils/sort.ts` now holds only a filter, so it is
renamed to `utils/filter.ts`.

* fix(resources): sort unknown owners last and align the knowledge sort menu

An owner id that resolves to no workspace member renders an empty cell,
but its sort key was `''`, so those rows floated to the TOP of an
ascending Owner sort while every other valueless cell sorted last. They
now key `null` and follow the same nulls-last rule on all three pages.

The Knowledge sort menu also listed Owner after Last Updated while its
column order — and Tables' menu — put Owner before it.

* chore(knowledge): delete the dead base-card grid view

`BaseCard`/`BaseCardSkeleton`/`BaseCardSkeletonGrid` were the pre-redesign
grid-card knowledge base view, kept alive only by the barrel re-export —
no call sites since the Resource list replaced it.

Removing it orphans `components/constants.ts` entirely (its sort types
went with the dead sort; its three class-name constants had no consumers
left), so that goes too.
2026-08-03 11:32:44 -07:00

Sim.ai Documentation Slack X

Ask DeepWiki Set Up with Cursor

Sim — Integrate, Context, Build, and Monitor AI agents

A workspace to build, deploy and manage AI agents and workflows.

Quickstart

Cloud-hosted: sim.ai

Open sim.ai

Self-hosted

git clone https://github.com/simstudioai/sim.git && cd sim
bun run setup

Open http://localhost:3000

The Sim platform — chat on the left, the visual workflow builder on the right

Capabilities

  • Connect 1,000+ integrations and every major LLM
  • Add Slack, Notion, HubSpot, Salesforce, databases, and more
  • Build agents visually, conversationally, or with code
  • Ingest files, knowledge bases, and structured table data
  • Monitor runs, logs, schedules, and workflow activity

One workspace, every surface

Chat and workflows are just the start — tables, files, knowledge, and scheduled tasks all live in the same workspace.

Tables in Sim — structured data your agents can query

Tables — a database, built in

Files in Sim — documents for your team and every agent

Files — one store for your team and every agent

Knowledge bases in Sim — synced docs your agents can search

Knowledge — your agents' memory

Scheduled tasks in Sim — recurring agent runs on a calendar

Scheduled tasks — runs on your schedule

Self-hosting

Requirements: Bun and Docker.

bun run setup is an interactive wizard: it provisions the database, generates secrets, writes your .env files, connects a Chat API key, and starts Sim the way you choose:

  • Local dev — run from source to contribute or hack on Sim
  • Docker Compose — a self-contained instance for testing self-hosting
  • Kubernetes (Helm) — deploy to a local cluster

When it finishes, open http://localhost:3000.

Manage your install with bun run sim:

bun run sim start | stop | restart   # bring your install up / down / cycle
bun run sim status                    # what's installed and healthy
bun run sim logs                      # follow logs
bun run sim doctor                    # diagnose configuration problems
bun run sim down                      # remove containers (data kept)
bun run sim reset                     # archive .env and wipe managed data

sim detects how you're running (Docker Compose, local dev, or Kubernetes) and acts accordingly.

Prefer a bare sim? Run bun link once — but note sim lands in ~/.bun/bin, which Homebrew's bun doesn't add to your PATH, so you may need export PATH="$HOME/.bun/bin:$PATH" in your shell profile.

Sim also supports local models via Ollama and vLLM. See the self-hosting docs for details.

Chat API Keys

Chat is a Sim-managed service. bun run setup connects a Chat API key for you — sign in when it opens your browser and the key is stored automatically. To view, create, or revoke keys later, go to sim.ai/selfhost/settings/chat-keys.

Environment Variables

See the environment variables reference for the full list, or apps/sim/.env.example for defaults.

Tech Stack

Next.js · Bun · PostgreSQL · Drizzle · Better Auth · Tailwind — and the rest of the stack

Contributing

We welcome contributions! Please see our Contributing Guide for details.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Built by the Sim team in San Francisco

Languages
TypeScript 77%
MDX 20.8%
JavaScript 1.9%
CSS 0.1%