Skip to content

Commit

Permalink
Merge pull request #55 from taroj1205/fix/dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
taroj1205 authored Nov 18, 2024
2 parents 0ed6378 + cd7525a commit fbffd06
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/new-bees-punch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"clippr": patch
---

Fixed how check icon was not shown in dropdown
41 changes: 34 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,40 @@ jobs:
- name: Build the app
run: pnpm tauri build

- name: Get Changelog Entry
id: get-changelog
- name: Get Latest Release PR Content
id: get-pr-content
shell: pwsh
run: |
CHANGELOG_CONTENT=$(awk '/^## / {count++} count==1 {print} count>1 {exit}' CHANGELOG.md | sed '1d')
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG_CONTENT" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
try {
# Get PR content and explicitly convert the output to string before parsing
$prs = (gh pr list --search "author:app/github-actions is:merged" --json number,title,body --limit 1) | Out-String
$pr = $prs | ConvertFrom-Json
if ($pr) {
$prBody = $pr[0].body
$lines = $prBody -split '\r?\n'
$contentStartIndex = 0
foreach ($index in 0..($lines.Count-1)) {
if ($lines[$index] -match '### ') {
$contentStartIndex = $index
break
}
}
$releaseNotes = ($lines | Select-Object -Skip $contentStartIndex) -join "`n"
$releaseNotes = $releaseNotes -replace '####\s', '### ' -replace '###\s', '## '
$releaseNotes = $releaseNotes.Trim()
echo "content<<EOF" >> $env:GITHUB_OUTPUT
echo $releaseNotes >> $env:GITHUB_OUTPUT
echo "EOF" >> $env:GITHUB_OUTPUT
} else {
echo "No recent changeset PR found"
exit 1
}
} catch {
echo "Error processing PR content: $_"
exit 1
}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release
uses: softprops/action-gh-release@v1
Expand All @@ -54,6 +81,6 @@ jobs:
src-tauri/target/release/bundle/msi/*.msi
src-tauri/target/release/bundle/nsis/*.exe
src-tauri/target/release/Clippr.exe
body: ${{ steps.get-changelog.outputs.changelog }}
body: ${{ steps.get-pr-content.outputs.content }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 35 additions & 3 deletions src/components/search-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,26 @@ export const SearchInput: Component<SearchInputProps> = (props) => {
{(sort) => (
<button
onClick={() => selectSort(sort.value)}
class="w-full px-3 py-2 text-left text-gray-300 hover:text-white hover:bg-gray-700/50"
class="w-full px-3 py-2 text-left text-gray-300 hover:text-white hover:bg-gray-700/50 flex items-center justify-between"
>
{sort.label}
<span class={sort.value === props.selectedSort() ? "text-white" : ""}>
{sort.label}
</span>
{sort.value === props.selectedSort() && (
<svg
class="w-4 h-4 text-white"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M5 13l4 4L19 7"
/>
</svg>
)}
</button>
)}
</For>
Expand Down Expand Up @@ -190,7 +207,7 @@ export const SearchInput: Component<SearchInputProps> = (props) => {
{(type) => (
<button
onClick={() => selectType(type.value)}
class="w-full px-3 py-2 text-left text-gray-300 hover:text-white hover:bg-gray-700/50"
class="w-full px-3 py-2 text-left text-gray-300 hover:text-white hover:bg-gray-700/50 flex items-center justify-between"
>
<span
class={
Expand All @@ -201,6 +218,21 @@ export const SearchInput: Component<SearchInputProps> = (props) => {
>
{type.label}
</span>
{props.selectedTypes().includes(type.value) && (
<svg
class="w-4 h-4 text-white"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M5 13l4 4L19 7"
/>
</svg>
)}
</button>
)}
</For>
Expand Down

0 comments on commit fbffd06

Please sign in to comment.