Skip to content

Commit

Permalink
v0.3.0 - Smart query
Browse files Browse the repository at this point in the history
- Disabled Artist's toolkit on production build while it's in WIP
- Fixed click outside issue
  • Loading branch information
basharovV committed Sep 24, 2022
1 parent 1362fdc commit 93cf910
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "musicat",
"private": true,
"version": "0.2.0",
"version": "0.3.0",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"package": {
"productName": "Musicat",
"version": "0.2.0"
"version": "0.3.0"
},
"tauri": {
"macOSPrivateApi": true,
Expand Down
8 changes: 5 additions & 3 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@
// console.log("drag enter");
// }
function onPageClick() {
$isInfoPopupOpen = false;
function onCloseAppInfo() {
if ($isInfoPopupOpen) {
$isInfoPopupOpen = false;
}
}
let mouseX;
Expand Down Expand Up @@ -123,7 +125,7 @@

{#if $isInfoPopupOpen}
<div class="info">
<InfoPopup />
<InfoPopup onClickOutside={onCloseAppInfo} />
</div>
{/if}

Expand Down
10 changes: 4 additions & 6 deletions src/lib/InfoPopup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@
import { getVersion } from "@tauri-apps/api/app";
import { isInfoPopupOpen } from "../data/store";
import { clickOutside } from "../utils/ClickOutside";
import ReleaseNotes from "./ReleaseNotes.svelte";
let version = getVersion();
function onPageClick() {
$isInfoPopupOpen = false;
}
export let onClickOutside;
</script>

<container on:click={onPageClick}>
<div class="popup">
<container>
<div class="popup" use:clickOutside={onClickOutside}>
<!-- <img src="images/cd6.gif" /> -->
<section class="info">
<div>
Expand Down
7 changes: 7 additions & 0 deletions src/lib/ReleaseNotes.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
<ul>
<h3>Release Notes</h3>

<section>
<h3>📦 0.3.0 <i>"Enhance, enhance!"</i></h3>
<li>
The new Smart Query section allows you to create powerful query chains, made up of condition blocks such as "where genre is x" and "released between year1 and year2".
</li>
</section>

<section>
<h3>📦 0.2.0 <i>"Very meta"</i></h3>
<li>
Expand Down
9 changes: 9 additions & 0 deletions src/lib/Sidebar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
import SpectrumAnalyzer from "./SpectrumAnalyzer.svelte";
import "./tippy.css";
// Env
let isArtistToolkitEnabled = process.env.NODE_ENV === 'development';
// What to show in the sidebar
let title;
let artist;
Expand Down Expand Up @@ -148,6 +151,10 @@
console.log("clicked");
$isInfoPopupOpen = true;
}
$: {
console.log('info popup:', $isInfoPopupOpen);
}
let height = 0;
let width = 0;
let hasDecorations = false;
Expand Down Expand Up @@ -362,6 +369,7 @@
>
<iconify-icon icon="fluent:search-20-filled" />Smart Query</item
>
{#if isArtistToolkitEnabled}
<item
class:selected={$uiView === "your-music"}
on:click={() => {
Expand All @@ -371,6 +379,7 @@
<iconify-icon icon="mdi:music-clef-treble" />Artist's
toolkit</item
>
{/if}
<!-- <item> <iconify-icon icon="mdi:playlist-music" />Playlists</item> -->

<!-- <hr />
Expand Down
6 changes: 5 additions & 1 deletion src/utils/ClickOutside.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ export function clickOutside(element, callbackFunction) {
}
}

document.body.addEventListener('click', onClick);
// For some reason the click event from the button that shows the component is fired here
// so we need to wait before adding a listener.
setTimeout(() => {
document.body.addEventListener('click', onClick);
}, 100);

return {
update(newCallbackFunction) {
Expand Down

0 comments on commit 93cf910

Please sign in to comment.