Skip to content

Commit 8a03ab1

Browse files
committed
chore: release v0.16.0
Version Updates: - Bump package version to 0.16.0 - Update CHANGELOG with v0.16.0 release notes Bug Fixes: - Fix ThemeProvider useEffect causing test failures - Skip defaultTheme sync on initial mount to preserve localStorage/system theme - Remove theme from dependency array to prevent infinite loops - Fixes 7 failing ThemeProvider tests Changes in v0.16.0: - Map: Multi-tile provider support with 15+ presets - Map: hideAttribution prop to control attribution visibility - ExpandableText: Enhanced text truncation and capitalized labels - ExpandableText: Increased default maxLines from 3 to 4 - MapInspector: Fixed literal <br> tags in descriptions - Storybook: Fixed dark mode toggle functionality
1 parent 70d0ddb commit 8a03ab1

File tree

4 files changed

+51
-4
lines changed

4 files changed

+51
-4
lines changed

CHANGELOG.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,44 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.16.0] - 2025-11-25
11+
12+
### Added
13+
14+
- **Map Component Features**:
15+
- **Multi-Tile Provider Support**: Added 15+ built-in tile provider presets
16+
- OpenStreetMap variants (Standard, HOT, France, Black & White)
17+
- CartoDB variants (Positron, Voyager, Dark Matter)
18+
- Stadia Maps (OSM Bright, Outdoors, Alidade Smooth)
19+
- Stamen terrain maps
20+
- USGS topographic maps
21+
- Easily switch between providers with `tileProvider` prop
22+
- **Attribution Control**: New `hideAttribution` prop to hide tile provider attribution
23+
- Default: `false` (attribution shown)
24+
- Useful for screenshots or when attribution is provided elsewhere
25+
26+
### Changed
27+
28+
- **ExpandableText Component**:
29+
- Enhanced text truncation logic for more accurate line counting
30+
- Updated default labels: "view more" → "View more", "view less" → "View less" (capitalized)
31+
- Improved HTML tag support documentation with `<br>` tag examples
32+
- Increased default `maxLines` from 3 to 4 for better content preview
33+
34+
### Fixed
35+
36+
- **Map Component**:
37+
- Cleaner attribution display with proper spacing and formatting
38+
- **ExpandableText Component**:
39+
- Fixed text rendering to properly handle browser default line heights
40+
- Improved expand/collapse behavior for edge cases
41+
- **MapInspector Component**:
42+
- Fixed literal `<br>` tags displaying in descriptions instead of line breaks
43+
- Now properly renders HTML line breaks in location descriptions
44+
- **Storybook**:
45+
- Fixed dark mode toggle functionality in Storybook environment
46+
- Theme switching now works correctly for development and documentation
47+
1048
## [0.15.0] - 2025-11-25
1149

1250
### Added

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ainativekit/root",
3-
"version": "0.14.0",
3+
"version": "0.16.0",
44
"private": true,
55
"type": "module",
66
"description": "AI Native Kit - UI library for ChatGPT Apps SDK",

packages/ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ainativekit/ui",
3-
"version": "0.15.0",
3+
"version": "0.16.0",
44
"description": "React UI component library for ChatGPT Apps SDK - Production-ready components, hooks, and design system",
55
"type": "module",
66
"main": "./dist/index.cjs",

packages/ui/src/providers/ThemeProvider.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,9 @@ export const ThemeProvider: React.FC<ThemeProviderProps> = ({
332332
// Ref to track injected style element for brand colors
333333
const styleElementRef = useRef<HTMLStyleElement | null>(null);
334334

335+
// Ref to track if this is the initial mount
336+
const isInitialMount = useRef(true);
337+
335338
// Memoize CSS generation to avoid unnecessary recalculation
336339
const brandColorCSS = useMemo(() => {
337340
if (!brandColors) return '';
@@ -346,11 +349,17 @@ export const ThemeProvider: React.FC<ThemeProviderProps> = ({
346349
}, [chatGPTTheme]);
347350

348351
// Sync with defaultTheme prop changes (for Storybook and external control)
352+
// Skip on initial mount to preserve theme from localStorage/system preference
349353
useEffect(() => {
350-
if (!chatGPTTheme && defaultTheme && defaultTheme !== theme) {
354+
if (isInitialMount.current) {
355+
isInitialMount.current = false;
356+
return;
357+
}
358+
359+
if (!chatGPTTheme && defaultTheme) {
351360
setThemeState(defaultTheme);
352361
}
353-
}, [defaultTheme, chatGPTTheme, theme]);
362+
}, [defaultTheme, chatGPTTheme]);
354363

355364
// Apply theme to DOM
356365
useEffect(() => {

0 commit comments

Comments
 (0)