xiaohongshu
xiaohongshu
filters-building
Building table filters with query parameters, model search, and supported query patterns
Full skill instructions
type FilterType =
| "simple-select" // Constants (single)
| "multi-select" // Constants (multiple)
| "model-select" // Model relationship (small lists)
| "model-multi-select" // Model relationships (small lists)
| "model-search-select" // Model relationship (large lists)
| "model-search-multi-select" // Model relationships (large lists)
| "text" // Text input
| "email" // Email input
| "number" // Number input
| "checkbox" // Boolean 0/1
| "date-range" // Date range picker
| "gap"; // Visual spacing
Field can be string OR object:
// Simple string - used for all three
field: "organization_id"
// Complex object for custom queries
field: {
queryParam: "organization_type_id", // URL query param
postgresColumn: "organizations.type", // Postgres column
elasticsearchColumn: "organization_type_id" // ES column
}
| Query Parameter | SQL Result | Description |
|---|---|---|
?name=john | WHERE account.name = 'john' | Exact match |
?name[]=john&name[]=jane | WHERE account.name IN('john','jane') | Multiple values |
?not:name=john | WHERE account.name != 'john' | Not equal |
?q:name=john | WHERE LOWER(account.name) ILIKE '%john%' | Like search |
?gt:age=25 | WHERE account.age > 25 | Greater than |
?lt:age=65 | WHERE account.age < 65 | Less than |
?between:age=25|65 | WHERE account.age >= 25 AND account.age <= 65 | Range |
{
type: "gap",
placeholder: "",
label: "Organization Filters",
field: "",
}
{
placeholder: "Search Name",
type: "text",
field: "name", // Uses q:name for ILIKE search
}
{
placeholder: "Is Active",
type: "checkbox",
field: "is_active",
checkedValue: "1",
uncheckedValue: "",
}
import { constants } from "@/models/constants";
{
placeholder: "Status",
type: "simple-select",
field: "status",
options: constants.asset.status,
}
{
placeholder: "Organization Type",
type: "multi-select",
field: {
queryParam: "organization_type_id",
postgresColumn: "organizations.type",
elasticsearchColumn: "organization_type_id",
},
options: constants.organization.type,
}
For < 50 options:
{
placeholder: "Organization",
type: "model-select",
field: "organization_id",
modelName: "organization",
modelDisplayField: "label",
modelSearchFilters: { disabled: "0" },
}
{
placeholder: "Tags",
type: "model-multi-select",
field: "tag_ids",
modelName: "tag",
modelDisplayField: "label",
modelSearchFilters: { disabled: "0" },
}
For > 50 options:
{
placeholder: "Organization",
type: "model-search-select",
field: "organization_id",
modelName: "organization",
modelDisplayField: "label",
modelSearchParam: "q",
modelSearchFilters: { disabled: "0" },
}
{
placeholder: "Organizations",
type: "model-search-multi-select",
field: "organization_id",
modelName: "organization",
modelDisplayField: "label",
modelSearchParam: "q",
modelSearchFilters: { disabled: "0" },
}
{
placeholder: "Created Date",
type: "date-range",
field: "created_at",
}
import { IFilterField } from "@/ui/common/components/types/filters";
import { constants } from "@/models/constants";
export const assetFilters: IFilterField[] = [
// Section 1: Basic Filters
{
placeholder: "Search Name",
type: "text",
field: "name",
},
{
placeholder: "Status",
type: "multi-select",
field: "status",
options: constants.asset.status,
},
{
placeholder: "Is Active",
type: "checkbox",
field: "is_active",
checkedValue: "1",
uncheckedValue: "",
},
// Gap for visual separation
{
type: "gap",
placeholder: "",
label: "Organization Filters",
field: "",
},
// Section 2: Relationships
{
placeholder: "Organization",
type: "model-search-multi-select",
field: "organization_id",
modelName: "organization",
modelDisplayField: "label",
modelSearchParam: "q",
modelSearchFilters: { disabled: "0" },
},
{
placeholder: "Organization Type",
type: "multi-select",
field: {
queryParam: "organization_type_id",
postgresColumn: "organizations.type",
elasticsearchColumn: "organization_type_id",
},
options: constants.organization.type,
},
// Gap for dates section
{
type: "gap",
placeholder: "",
label: "Date Filters",
field: "",
},
// Section 3: Dates
{
placeholder: "Created Date",
type: "date-range",
field: "created_at",
},
];
gap separatorslabel as modelDisplayField (modify model if needed)q as modelSearchParam for consistencyconstants.{model}.{field}| Data Type | Count | Filter Type |
|---|---|---|
| Text field | N/A | text |
| Email field | N/A | email |
| Number field | N/A | number |
| Boolean | N/A | checkbox |
| Date | N/A | date-range |
| Constants | 1 | simple-select |
| Constants | Many | multi-select |
| Model | < 50 | model-select or model-multi-select |
| Model | > 50 | model-search-select or model-search-multi-select |
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience