Skip to content

Commit 775286f

Browse files
authored
Merge pull request #42 from delegateas/patch/misc-changes-02
🚀 Search Performance & UX Enhancement Suite
2 parents ca7a709 + b2aa098 commit 775286f

18 files changed

Lines changed: 1131 additions & 289 deletions

.github/workflows/release.yml

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# .github/workflows/release.yml
21
name: Release
32

43
on:
@@ -17,7 +16,6 @@ on:
1716
jobs:
1817
release-please:
1918
runs-on: ubuntu-latest
20-
# Only run on merged PRs or manual dispatch
2119
if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged == true)
2220
outputs:
2321
releases_created: ${{ steps.manual_release.outputs.releases_created }}
@@ -38,58 +36,65 @@ jobs:
3836
run: |
3937
npm install -g release-please
4038
npm install semver
41-
42-
# Configure git
39+
4340
git config --global user.name "github-actions[bot]"
4441
git config --global user.email "github-actions[bot]@users.noreply.github.com"
45-
46-
# Get current version from manifest
42+
4743
CURRENT_VERSION=$(cat .release-please-manifest.json | jq -r '.Website')
4844
echo "Current version: $CURRENT_VERSION"
49-
50-
# Calculate next version based on release type using Node.js
45+
5146
NEXT_VERSION=$(node -e "
5247
const semver = require('semver');
5348
const current = '$CURRENT_VERSION';
5449
const type = '${{ github.event.inputs.release_type }}';
5550
console.log(semver.inc(current, type));
5651
")
57-
52+
5853
echo "Next version will be: $NEXT_VERSION"
59-
60-
# Update version in package.json
54+
6155
cd Website
6256
npm version $NEXT_VERSION --no-git-tag-version
6357
cd ..
64-
65-
# Update manifest file
58+
6659
jq --arg version "$NEXT_VERSION" '.Website = $version' .release-please-manifest.json > temp.json && mv temp.json .release-please-manifest.json
67-
68-
# Generate changelog entry
60+
6961
echo "## [$NEXT_VERSION] - $(date +'%Y-%m-%d')" > temp_changelog.md
7062
echo "" >> temp_changelog.md
7163
echo "### Changed" >> temp_changelog.md
72-
echo "- Manual ${{ github.event.inputs.release_type }} release" >> temp_changelog.md
64+
65+
LAST_TAG="website-v$CURRENT_VERSION"
66+
git fetch --tags
67+
if git rev-parse "$LAST_TAG" >/dev/null 2>&1; then
68+
echo "- Changes since $CURRENT_VERSION:" >> temp_changelog.md
69+
COMMITS=$(git log "$LAST_TAG"..HEAD --pretty=format:"- %s")
70+
if [ -n "$COMMITS" ]; then
71+
echo "$COMMITS" >> temp_changelog.md
72+
else
73+
echo "- No new commits since last version" >> temp_changelog.md
74+
fi
75+
else
76+
echo "- Manual ${{ github.event.inputs.release_type }} release" >> temp_changelog.md
77+
echo "- (No previous tag $LAST_TAG found to compare commits)" >> temp_changelog.md
78+
fi
7379
echo "" >> temp_changelog.md
74-
75-
# Prepend to existing changelog if it exists
80+
7681
if [ -f "Website/CHANGELOG.md" ]; then
7782
cat temp_changelog.md Website/CHANGELOG.md > temp_full_changelog.md
7883
mv temp_full_changelog.md Website/CHANGELOG.md
7984
else
8085
mv temp_changelog.md Website/CHANGELOG.md
8186
fi
82-
83-
# Commit and push changes
87+
8488
git add .
8589
git commit -m "chore(release): release $NEXT_VERSION
8690
8791
Release type: ${{ github.event.inputs.release_type }}
8892
Previous version: $CURRENT_VERSION
8993
New version: $NEXT_VERSION"
90-
91-
git push origin HEAD
92-
94+
95+
git tag -a "website-v$NEXT_VERSION" -m "Release $NEXT_VERSION"
96+
git push origin HEAD --tags
97+
9398
echo "releases_created=true" >> $GITHUB_OUTPUT
9499
echo "version=$NEXT_VERSION" >> $GITHUB_OUTPUT
95100

Website/app/page.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import { DatamodelView } from "@/components/datamodelview/DatamodelView";
22
import { TouchProvider } from "@/components/ui/hybridtooltop";
33
import { Loading } from "@/components/ui/loading";
4+
import { DatamodelDataProvider } from "@/contexts/DatamodelDataContext";
45
import { Suspense } from "react";
56

67
export default function Home() {
78
return <Suspense fallback={<Loading />}>
89
<TouchProvider>
9-
<DatamodelView />
10+
<DatamodelDataProvider>
11+
<DatamodelView />
12+
</DatamodelDataProvider>
1013
</TouchProvider>
1114
</Suspense>
1215
}

Website/components/AppSidebar.tsx

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,24 @@ import { SidebarClose, SidebarOpen } from 'lucide-react'
55
import { useIsMobile } from '@/hooks/use-mobile'
66
import SidebarNavRail from './SidebarNavRail'
77
import clsx from 'clsx'
8+
import { useState } from 'react';
89

910
interface IAppSidebarProps {}
1011

1112
export const AppSidebar = ({}: IAppSidebarProps) => {
1213
const { element, isOpen } = useSidebar()
1314
const dispatch = useSidebarDispatch()
1415
const isMobile = useIsMobile()
16+
const [showElement, setShowElement] = useState(true)
1517

1618
const toggleSidebar = () => {
1719
dispatch({ type: 'SET_OPEN', payload: !isOpen })
1820
}
1921

22+
const toggleElement = () => {
23+
setShowElement(v => !v)
24+
}
25+
2026
return (
2127
<>
2228
{/* Toggle Button (mobile only) */}
@@ -32,31 +38,66 @@ export const AppSidebar = ({}: IAppSidebarProps) => {
3238
</button>
3339
)}
3440

41+
{/* Overlay for mobile sidebar */}
42+
{isMobile && isOpen && (
43+
<div
44+
className="fixed inset-0 bg-black bg-opacity-30 z-30"
45+
onClick={toggleSidebar}
46+
aria-label="Close sidebar overlay"
47+
/>
48+
)}
49+
3550
{/* Sidebar */}
3651
<div
37-
className={clsx('h-screen w-64 bg-sidebar border-r border-sidebar-border z-40 transition-transform duration-300',
52+
className={clsx(
53+
'h-screen bg-sidebar border-r border-sidebar-border z-40',
54+
'transition-all duration-300',
3855
isMobile
3956
? [
4057
'fixed top-0 left-0',
4158
isOpen ? 'translate-x-0' : '-translate-x-full',
42-
'flex flex-col'
59+
'flex flex-col',
60+
'w-64'
61+
]
62+
: [
63+
'flex flex-col sticky top-0'
4364
]
44-
: 'flex flex-col sticky top-0'
4565
)}
66+
style={
67+
isMobile
68+
? undefined
69+
: { width: showElement ? '16rem' : '3.5rem', transitionProperty: 'width' }
70+
}
4671
>
4772
{/* Header */}
48-
<div className="w-full h-16 border-b border-sidebar-border p-2 flex justify-center items-center bg-white">
73+
<div className="w-full h-16 border-b border-sidebar-border p-2 flex justify-center items-center bg-white relative">
4974
{isMobile ? (
5075
<img src="/DMVLOGO.svg" alt="Logo" className="h-full" draggable={false} />
5176
) : (
52-
<img src="/DMVLOGOHORZ.svg" alt="Logo" className="h-full" draggable={false} />
77+
showElement ? (
78+
<img src="/DMVLOGOHORZ.svg" alt="Logo" className="h-full" draggable={false} />
79+
) : (
80+
<img src="/DMVLOGO.svg" alt="Logo" className="h-full" draggable={false} />
81+
)
5382
)}
5483
</div>
5584

85+
{/* Vertically centered sidebar toggle button (desktop only) */}
86+
{!isMobile && (
87+
<button
88+
onClick={toggleElement}
89+
className="absolute right-0 top-1/2 -translate-y-1/2 w-4 h-12 bg-gray-50 border border-gray-300 shadow rounded-sm flex items-center justify-center z-50 hover:bg-blue-50"
90+
style={{ marginRight: '-12px' }}
91+
aria-label={showElement ? 'Hide Details' : 'Show Details'}
92+
>
93+
{showElement ? <SidebarClose size={10} /> : <SidebarOpen size={10} />}
94+
</button>
95+
)}
96+
5697
{/* Content */}
5798
<div className="flex-1 overflow-y-auto relative flex">
5899
<SidebarNavRail />
59-
{element}
100+
{(isMobile || showElement) && element}
60101
</div>
61102
</div>
62103
</>
Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,48 @@
1-
import { StatusAttributeType, StatusOption } from "@/lib/Types"
2-
import { formatNumberSeperator } from "@/lib/utils"
1+
import { StatusAttributeType, StatusOption } from "@/lib/Types";
2+
import { formatNumberSeperator } from "@/lib/utils";
3+
import { Circle } from "lucide-react";
34

45
export default function StatusAttribute({ attribute }: { attribute: StatusAttributeType }) {
56
const groupedOptions = attribute.Options.reduce((acc, option) => {
67
if (!acc[option.State]) {
7-
acc[option.State] = []
8+
acc[option.State] = [];
89
}
9-
acc[option.State].push(option)
10-
return acc
11-
}, {} as Record<string, StatusOption[]>)
10+
acc[option.State].push(option);
11+
return acc;
12+
}, {} as Record<string, StatusOption[]>);
1213

1314
return (
14-
<div className="flex flex-col gap-2 md:gap-4">
15-
<span className="font-semibold text-xs md:font-bold md:text-sm">State/Status</span>
15+
<div className="flex flex-col gap-1">
16+
<div className="flex items-center gap-2">
17+
<span className="font-semibold text-xs md:font-bold md:text-sm">State/Status</span>
18+
{/* No DefaultValue for StatusAttributeType, so no default badge */}
19+
</div>
1620
{Object.entries(groupedOptions).map(([state, options]) => (
1721
<div key={state} className="flex flex-col gap-1">
1822
<span className="font-medium text-xs md:text-sm">{state}</span>
19-
<div className="grid grid-cols-[1fr_auto] gap-x-2 gap-y-1 pl-2 md:gap-x-4 md:pl-4">
23+
<div className="space-y-1">
2024
{options.map(option => (
21-
<div key={option.Value} className="contents">
22-
<span className="text-xs md:text-sm">{option.Name}</span>
23-
<span className="text-right text-xs md:text-sm">{formatNumberSeperator(option.Value)}</span>
25+
<div key={option.Value}>
26+
<div className="flex items-center justify-between py-0.5 md:py-1">
27+
<div className="flex items-center gap-2">
28+
<div className="flex items-center gap-1">
29+
{/* No DefaultValue, so always show Circle icon */}
30+
<Circle className="w-2 h-2 text-gray-400 md:w-3 md:h-3" />
31+
<span className="text-xs md:text-sm">{option.Name}</span>
32+
</div>
33+
</div>
34+
<div className="flex items-center gap-2">
35+
<span className="text-xs bg-gray-200 text-gray-700 px-1 py-0.5 rounded font-mono md:px-1.5">
36+
{formatNumberSeperator(option.Value)}
37+
</span>
38+
</div>
39+
</div>
40+
{/* No Description property */}
2441
</div>
2542
))}
2643
</div>
2744
</div>
2845
))}
2946
</div>
30-
)
47+
);
3148
}

0 commit comments

Comments
 (0)