Skip to content

Add Airtable-style calendar view component#16

Merged
huangyiirene merged 5 commits intomainfrom
copilot/implement-airtable-calendar-component
Jan 14, 2026
Merged

Add Airtable-style calendar view component#16
huangyiirene merged 5 commits intomainfrom
copilot/implement-airtable-calendar-component

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 13, 2026

Implementation Plan: Airtable Calendar Component

  • Create calendar view UI component (month/week/day grid)
  • Create event item component for displaying records as calendar events
  • Implement calendar renderer component that integrates with ComponentRegistry
  • Add calendar view to complex renderers
  • Export calendar renderer from index
  • Test the calendar component with sample data
  • Verify build process works
  • Create documentation/example
  • Address code review feedback
  • Address PR review comments (JSDoc and property redundancy)

Summary

Successfully implemented an Airtable-style calendar component for Object UI with the following features:

Features Implemented

Three View Modes: Month, Week, and Day views with smooth switching
Flexible Data Mapping: Configure field names for title, dates, and colors
Color Coding: Support for custom color mappings based on event types
Interactive Navigation: Previous/Next buttons and "Today" quick navigation
Event Display: Smart event rendering with time display for non-all-day events
Multi-day Events: Properly displays events spanning multiple days
Responsive Design: Tailwind CSS styling with full customization support
JSDoc Documentation: All field mappings documented for auto-generation

Components Created

  • CalendarView UI component (packages/components/src/ui/calendar-view.tsx)
  • calendar-view renderer (packages/components/src/renderers/complex/calendar-view.tsx)
  • Documentation (docs/components/calendar-view.md)
  • Playground example with sample data

Recent Changes

Screenshot

Calendar View

Usage Example

{
  "type": "calendar-view",
  "view": "month",
  "colorField": "type",
  "colorMapping": {
    "meeting": "#3b82f6",
    "deadline": "#ef4444",
    "event": "#10b981"
  },
  "data": [
    {
      "id": 1,
      "title": "Team Meeting",
      "start": "2026-01-13T10:00:00.000Z",
      "type": "meeting"
    }
  ]
}
Original prompt

实现airtable日历组件


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits January 13, 2026 18:52
- Created CalendarView UI component with month/week/day views
- Created calendar-view renderer for ComponentRegistry
- Added support for data field mapping (title, dates, colors)
- Integrated with existing component system

Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
- Added calendar-view example to playground
- Updated component library documentation
- Created comprehensive calendar-view component documentation
- Tested all three view modes (month, week, day)

Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
- Remove unused CalendarIcon import
- Extract default event color to constant
- Fix date mutation issue in getEventsForDate function
- Improve date comparison logic

Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
Copilot AI changed the title [WIP] Create Airtable calendar component for project Add Airtable-style calendar view component Jan 13, 2026
Copilot AI requested a review from huangyiirene January 13, 2026 19:02
@huangyiirene huangyiirene requested review from Copilot and removed request for huangyiirene January 13, 2026 23:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements an Airtable-style calendar view component for displaying records as events with Month, Week, and Day view modes. The implementation follows the Object UI architecture by providing both a base UI component and a schema-driven renderer that maps data fields to calendar events.

Changes:

  • Added CalendarView UI component with navigation controls and three view modes
  • Created schema-driven renderer with flexible field mapping and color coding support
  • Added documentation and playground examples

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/components/src/ui/calendar-view.tsx Base calendar UI component with Month/Week/Day views and event rendering
packages/components/src/ui/index.ts Export statement for calendar-view component
packages/components/src/renderers/complex/calendar-view.tsx Schema-driven renderer with field mapping and action callbacks
packages/components/src/renderers/complex/index.ts Import statement for calendar-view renderer
docs/components/calendar-view.md Component documentation with usage examples and API reference
docs/spec/component-library.md Added calendar-view to component library spec
apps/playground/src/data/examples.ts Added calendar-view example with sample event data

Comment on lines +14 to +18
const titleField = schema.titleField || 'title';
const startField = schema.startDateField || 'start';
const endField = schema.endDateField || 'end';
const colorField = schema.colorField || 'color';
const allDayField = schema.allDayField || 'allDay';
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These field name mappings lack JSDoc comments explaining their purpose. According to Rule #3 (Schema First Mindset), every property in the Schema MUST have JSDoc to enable auto-generation of documentation.

Copilot generated this review using guidance from repository custom instructions.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added JSDoc comments to all field name mappings (titleField, startDateField, endDateField, colorField, allDayField) for auto-documentation generation. See commit 4f7d2ea.

return (
<CalendarView
events={events}
view={schema.view || schema.defaultView || 'month'}
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both 'view' and 'defaultView' properties serve the same purpose, creating redundancy. The inputs array at lines 156-168 also defines both. Consider using only one property name for clarity.

Suggested change
view={schema.view || schema.defaultView || 'month'}
view={schema.view || 'month'}

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the redundant defaultView property and updated the code to use only view with improved label and description. See commit 4f7d2ea.

@huangyiirene
Copy link
Copy Markdown
Contributor

@copilot 修正所有并运行完整测试

…roperty

- Added JSDoc comments to field name mappings (titleField, startField, etc.) for auto-documentation
- Removed redundant 'defaultView' property, keeping only 'view' for clarity
- Updated 'view' property label to 'View Mode' with description

Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 14, 2026

@copilot 修正所有并运行完整测试

✅ 已修正所有PR评审意见并运行完整测试套件:

修正内容 (commit 4f7d2ea):

  1. 添加了JSDoc注释到字段映射 (titleField, startDateField, endDateField, colorField, allDayField)
  2. 移除了冗余的 defaultView 属性,仅保留 view 属性
  3. 更新了属性标签和描述

测试结果:

  • ✅ packages/core: 1 passed
  • ✅ packages/react: 2 passed
  • ✅ packages/components: 1 passed
  • ✅ packages/designer: 6 passed
  • ✅ 总计: 10/10 tests passed

日历组件功能正常,所有三个视图模式(月/周/日)运行良好。

Screenshot

@github-actions
Copy link
Copy Markdown
Contributor

✅ All checks passed!

  • ✅ Type check passed
  • ✅ Tests passed
  • ✅ Lint check completed

@huangyiirene huangyiirene marked this pull request as ready for review January 14, 2026 00:09
@huangyiirene huangyiirene merged commit 16b44d4 into main Jan 14, 2026
1 of 5 checks passed
Copilot AI added a commit that referenced this pull request Feb 23, 2026
- #39 showRecordCount: conditionally show/hide record count bar
- #24 rowHeight: add short and extra_tall mapping in ListView + bridge
- #7 sort: parse legacy string format "field desc"
- #22 description: render view description below toolbar
- #40 allowPrinting: add print button with window.print()
- #31 virtualScroll: forward flag to grid view schema
- #35 userActions: wire sort/search/filter/rowHeight to toolbar visibility
- #38 addRecord: render "+ Add Record" button from spec config
- #37 tabs: render tab bar UI for view tabs
- #9 filterableFields: restrict FilterBuilder to whitelist fields
- #8 searchableFields: scope search queries to specified fields
- #36 appearance: wire showDescription and allowedVisualizations
- #16 pageSizeOptions: add page size selector UI in status bar
- #17-21: use spec kanban/calendar/gantt/gallery/timeline configs
- #20 gallery: add typed GalleryConfig to ListViewSchema
- #21 timeline: add typed TimelineConfig to ListViewSchema
- Bridge: add short/extra_tall density mapping, filterableFields pass-through

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants