Platform Feature App Example - Closest Preview
Platform Feature App Example - Closest Preview
Overview
This section uses a platform feature app to illustrate how AI tools apply effectively in real development scenarios.
Platform Feature Apps are apps that enhance Contentful’s own functionality, improving how editors and developers work inside the platform. These might take the form of sidebar helpers, custom dashboards, or AI-powered assistants that support content creation and management.
Business context
Content editors often need to see how their work will appear on the live website, but previewing content directly in Contentful can be challenging. While Live Preview enable editors to view changes in context, understanding which page an individual component or entry belongs to can still be time-consuming.
In Contentful, content is often structured so that page entries reference other types of entries—such as components, sections, or modules—that hold the actual content. This means that even if a component is ready, editors must first locate the page that includes it in order to see how it will look in the full layout.
The Closest Preview app streamlines this process by automatically identifying the nearest page entry with content preview enabled. In each entry’s sidebar, editors can quickly access a link to this closest page and preview the content. This makes content review more efficient, reduces unnecessary revisions, and ensures editors can see exactly how their work will appear on the live site.
Goal
Enable content editors to quickly find the page that uses their component so they can preview it.
AI-assisted development process
1. Research and planning
What we did: Analyzed content hierarchy navigation requirements and explored technical approaches for finding closest page-level entries.
AI contribution:
- Researched Contentful’s content model and entry relationship patterns.
- Suggested technical approaches for traversing content hierarchies to find page-level parents.
- Identified performance considerations for large content volumes and complex relationships.
- Explored integration possibilities with Contentful’s existing preview system and Live Preview functionality.
- Proposed multiple implementation designs for content hierarchy navigation.
Human insight:
- Validated requirements against Contentful’s platform capabilities and content model structure.
- Added context about content editor workflows and preview usage patterns.
- Refined scope based on actual user pain points and content hierarchy navigation needs.
Result: Clear understanding of content hierarchy navigation possibilities and user needs.
Example scenario:
The Config Screen location has a Multiselect which needs to show only content types that don’t have content preview enabled. To achieve the goal we asked the following to the agent:
After some back and forth with the agent we obtained the following information:
After following the human-in-the-loop principle we concluded that the most reliable and maintainable approach is to:
- Fetch all content types using the standard CMA endpoint
- Check field definitions for the presence of a slug field
- Filter out content types that have slug fields (indicating live preview)
This solution is simple, reliable, and works within Contentful’s current API limitations while providing the functionality needed for the Closest Preview app.
2. Feature building
With technical requirements defined, the team adopted an iterative approach to build features step by step.
2.1. UI prototyping
What we did: Converted designs into functional UI skeleton components for the sidebar app.
AI contribution:
- Generated React components for the sidebar app interface.
- Produced the initial UI skeleton from mockups and descriptions.
- Suggested responsive layouts for preview links and navigation controls.
- Proposed UX improvements for content editor workflows.
Human insight:
- Enhanced UX with feedback from content editors.
- Added accessibility features to the sidebar interface.
- Refined workflows to match real content editing processes.
- Added validation feedback and user guidance for preview navigation.
Result: UI component skeleton that defined the sidebar app interface and user experience.
Example input:
Example output:
2.2. Logic implementation
What we did: What we did: Built the content hierarchy navigation logic using a test-driven development approach.
AI contribution:
- Generated TypeScript interfaces for content hierarchy traversal and page finding.
- Created test suites covering content relationship queries and navigation logic.
- Suggested state management patterns for closest page discovery.
- Implemented preview URL generation for found page-level entries.
Human insight:
- Integrated with Contentful’s CMA to query entry relationships and content types.
- Handled edge cases and performance optimization for large content volumes with complex hierarchies.
- Implemented error handling and fallback mechanisms for hierarchy traversal failures.
- Added caching strategies for improved content hierarchy navigation performance.
Result: Prototype with test coverage that met content hierarchy navigation requirements.
Example input:
3. Optimization and refinement
What we did: Refactored the content hierarchy navigation code, optimized performance, and added advanced features for production use.
AI contribution:
- Suggested code refactoring patterns to improve maintainability and reduce duplication.
- Optimized content hierarchy traversal and reduced redundant API calls.
- Suggested performance optimizations for large content volumes with complex relationships.
Human insight:
- Scoped features to content editor needs.
- Reduced unnecessary complexity in hierarchy navigation logic.
- Added governance rules for content access and relationship validation.
- Implemented error handling and retry mechanisms for hierarchy traversal failures.
Result: Production-ready content hierarchy navigation aligned with content editor requirements.
Example input:
Outcome
- Content editors can quickly navigate to the closest page-level entry to access Live Preview functionality.
- The app reduces the time needed to find relevant page contexts for non-page content.
- Improved content editing workflow with direct access to preview functionality for all content types.
Conclusions
The platform feature app streamlined editorial workflows by letting editors jump directly to the closest page with preview enabled.
AI contributed significantly to exploring content hierarchy navigation approaches and generating UI prototypes. This helped the team quickly test multiple technical solutions.
Unlike integration apps, platform feature apps exist mostly within Contentful’s ecosystem. This made AI contributions more immediately applicable. With fewer external business dependencies, the team implemented AI-suggested solutions faster.
AI has a stronger impact on platform feature apps, where complexity lies more in technical execution than in understanding external business models.
Lessons learned
- Faster iteration cycles — AI accelerated development by reducing iteration loops and providing ready-to-test code and navigation logic.
- Essential editor feedback — Editors’ feedback ensured that UX improvements matched real workflows.
- Performance tuning — Performance optimization and caching required human insight, but AI helped identify candidate solutions more quickly.