Skip to content

Commit

Permalink
release: v2022.11.6
Browse files Browse the repository at this point in the history
  • Loading branch information
a5huynh committed Nov 17, 2022
2 parents aee4ae5 + bcfd0a6 commit 9668a88
Show file tree
Hide file tree
Showing 37 changed files with 675 additions and 270 deletions.
109 changes: 22 additions & 87 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<br />
<br />
Download now:
<a href="https://github.com/a5huynh/spyglass/releases/download/v2022.11.4/Spyglass_22.11.4_x64.dmg">
<a href="https://github.com/a5huynh/spyglass/releases/download/v2022.11.5/Spyglass_22.11.5_x64.dmg">
<strong>macOS</strong>
</a> |
<a href="https://github.com/a5huynh/spyglass/releases/download/v2022.11.4/Spyglass_22.11.4_x64_en-US.msi">
<a href="https://github.com/a5huynh/spyglass/releases/download/v2022.11.5/Spyglass_22.11.5_x64_en-US.msi">
<strong>Windows</strong>
</a> |
<a href="https://github.com/a5huynh/spyglass/releases/download/v2022.11.4/spyglass_22.11.4_amd64.AppImage">
<a href="https://github.com/a5huynh/spyglass/releases/download/v2022.11.5/spyglass_22.11.5_amd64.AppImage">
<strong>Linux (AppImage)</strong>
</a>
<br />
Expand Down
22 changes: 11 additions & 11 deletions VERSION.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"version": "22.11.4",
"notes": "See full release notes here: https://github.com/a5huynh/spyglass/releases/tag/v2022.11.4",
"pub_date": "2022-11-10T00:14:07Z",
"version": "22.11.5",
"notes": "See full release notes here: https://github.com/a5huynh/spyglass/releases/tag/v2022.11.5",
"pub_date": "2022-11-11T23:51:08Z",
"platforms": {
"darwin-x86_64": {
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRk9WYXdDUXphYm9wK1N0cWtLbFA1UHhxT2JrSGJXM2toTFlMa3B1UTNFV1BPN2hmUWtMQ2NuVHhlSTBENjBoTjM2dzRTSWtjOFFkRDRiQStoU3NBUU95aDdIOUpHcEFZPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjY4MDM5MTg2CWZpbGU6U3B5Z2xhc3MuYXBwLnRhci5negppVm5nK2hybHBKZzl6UUtMUHFQcDZoSWFKaXZndlp3Y21oeWNOOE5YMHZvbFVwWDNOZEdTSUswZFRvMWV3MHppeXB2K1B4N3dDM2p2OVdYb1RWaWhCZz09Cg==",
"url": "https://github.com/a5huynh/spyglass/releases/download/v2022.11.4/Spyglass.app.tar.gz"
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRk9WYXdDUXphYnRKM1orYmdMOXVSU3NnSVcweFlGdlpZOHYyWi9PZTAwVTA0MlZya0VpanFKM2dLWDBHK1QzVGVIRmlQaVNSM203ejFOS1RqUS9YZ0lDcmJ4Y29URlF3PQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjY4MjEwMjY4CWZpbGU6U3B5Z2xhc3MuYXBwLnRhci5negp5WTd2aXJrQ0hoTVBrVE85dGxoK1VNYWsrMjcrd1pWaEZyalh2cUhXY0xOSjA4UlVld2QrT2hZK240ZTM5amJWWGFyK0JMbVpKR0MveEhDa0JMQ0pCdz09Cg==",
"url": "https://github.com/a5huynh/spyglass/releases/download/v2022.11.5/Spyglass.app.tar.gz"
},
"darwin-aarch64": {
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRk9WYXdDUXphYm9wK1N0cWtLbFA1UHhxT2JrSGJXM2toTFlMa3B1UTNFV1BPN2hmUWtMQ2NuVHhlSTBENjBoTjM2dzRTSWtjOFFkRDRiQStoU3NBUU95aDdIOUpHcEFZPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjY4MDM5MTg2CWZpbGU6U3B5Z2xhc3MuYXBwLnRhci5negppVm5nK2hybHBKZzl6UUtMUHFQcDZoSWFKaXZndlp3Y21oeWNOOE5YMHZvbFVwWDNOZEdTSUswZFRvMWV3MHppeXB2K1B4N3dDM2p2OVdYb1RWaWhCZz09Cg==",
"url": "https://github.com/a5huynh/spyglass/releases/download/v2022.11.4/Spyglass.app.tar.gz"
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRk9WYXdDUXphYnRKM1orYmdMOXVSU3NnSVcweFlGdlpZOHYyWi9PZTAwVTA0MlZya0VpanFKM2dLWDBHK1QzVGVIRmlQaVNSM203ejFOS1RqUS9YZ0lDcmJ4Y29URlF3PQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjY4MjEwMjY4CWZpbGU6U3B5Z2xhc3MuYXBwLnRhci5negp5WTd2aXJrQ0hoTVBrVE85dGxoK1VNYWsrMjcrd1pWaEZyalh2cUhXY0xOSjA4UlVld2QrT2hZK240ZTM5amJWWGFyK0JMbVpKR0MveEhDa0JMQ0pCdz09Cg==",
"url": "https://github.com/a5huynh/spyglass/releases/download/v2022.11.5/Spyglass.app.tar.gz"
},
"linux-x86_64": {
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRk9WYXdDUXphYnJJL3F5UWJZbldBQ3JSMUJXb3NDT1ErOEtnWmU0RDFWRFBkVjlLQ09seTc1anZLU09EMkVMNWFpMDMyY29EUEZzVmtPdTZON1F4dWpocDQrbklYdXdVPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjY4MDM3NTY5CWZpbGU6c3B5Z2xhc3NfMjIuMTEuNF9hbWQ2NC5BcHBJbWFnZS50YXIuZ3oKTk1vdUlCY000TStkUWtKS2xXem1kUlcySGZGRVREYjN3M216ZnoyeDE3cXFOMUtTM1F1U3U4aG1yUThkcllKNjRqYy82Z0ozOWNHR3VkczdxNUw5REE9PQo=",
"url": "https://github.com/a5huynh/spyglass/releases/download/v2022.11.4/spyglass_22.11.4_amd64.AppImage.tar.gz"
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRk9WYXdDUXphYnQ2elVvODd4ZHVNbGZ6a2VWdFZBNFp3dDRrYVRCdklNV1M4a2F3R0N2VGVrTE9ySCtldW4veG51bnBsMDZIamJwMnpHbk5tVGhNUkFDV3hMUElvdWdNPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjY4MjA4ODExCWZpbGU6c3B5Z2xhc3NfMjIuMTEuNV9hbWQ2NC5BcHBJbWFnZS50YXIuZ3oKd1JVWVYyWllwUk1qMkVreDAxbkRwbHNjRnNHQTZZS25xaDlRNit3WkNSOVN4YXpTdHZudU9zL1FXQzZGR1JVMXlLVytmbmJrczc1SzFoeUNpZzJBQlE9PQo=",
"url": "https://github.com/a5huynh/spyglass/releases/download/v2022.11.5/spyglass_22.11.5_amd64.AppImage.tar.gz"
},
"windows-x86_64": {
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRk9WYXdDUXphYmozYklGUUxwR2NnRnJGQnh1T3RSUEdFWXlMMEwvNzVoQzIvcmk2ekJzbjU1NStJZHpkbHhFc1Z5SkFSdjBlcDVKSWU2Tk9nRk1WZUpMNmV6TEV5UlE0PQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjY4MDM5MTUzCWZpbGU6U3B5Z2xhc3NfMjIuMTEuNF94NjRfZW4tVVMubXNpLnppcApRVUVGL21LS1dZZ3RiaVQyalpqdG03eWdmZkpaWVF1MWg2dUQ2QUdobnBBQjlQNm8vY3g1YTRzeXl6UXNIQVMzdkhmc1BhOTdFRUVjNFFrcFVNbjBCUT09Cg==",
"url": "https://github.com/a5huynh/spyglass/releases/download/v2022.11.4/Spyglass_22.11.4_x64_en-US.msi.zip"
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRk9WYXdDUXphYnJjcDZlNzd1N2hqNE5KMmNGQ05pd1lFRE8yY211elVHUVIxNC9NcXJIdXdHZ3Zzcjh2bHpUVC9BMDFxQzFkMGF6THJSN0RDMUx1cU5INkJSZGFwWndRPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjY4MjA5Nzg0CWZpbGU6U3B5Z2xhc3NfMjIuMTEuNV94NjRfZW4tVVMubXNpLnppcApCT0V0QW9TYUVNa3A5ckFGSUpIeTVPT1Z0MXkvVnhnVXc5MFQxSUFRY1cvR1JTVCt0NWp5VUVnVTZFck1ZRlJ4UFNYTnR5Um5lYTNHUjZSSVJ0NHFCdz09Cg==",
"url": "https://github.com/a5huynh/spyglass/releases/download/v2022.11.5/Spyglass_22.11.5_x64_en-US.msi.zip"
}
}
}
2 changes: 1 addition & 1 deletion crates/client/public/main.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion crates/client/src/pages/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub struct SettingsPageProps {

#[function_component(SettingsPage)]
pub fn settings_page(props: &SettingsPageProps) -> Html {
let history = use_history().unwrap();
let history = use_history().expect("History not available in this browser");

spawn_local(async move {
let cb = Closure::wrap(Box::new(move |payload: JsValue| {
Expand Down
10 changes: 6 additions & 4 deletions crates/client/src/pages/crawl_stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ fn fetch_crawl_stats(
spawn_local(async move {
match invoke(ClientInvoke::GetCrawlStats.as_ref(), JsValue::NULL).await {
Ok(results) => {
let results: CrawlStats = serde_wasm_bindgen::from_value(results).unwrap();
let mut sorted = results.by_domain;
sorted.sort_by(|(_, a), (_, b)| b.num_completed.cmp(&a.num_completed));
stats_handle.set(sorted);
if let Ok(results) = serde_wasm_bindgen::from_value::<CrawlStats>(results) {
let mut sorted = results.by_domain;
sorted.sort_by(|(_, a), (_, b)| b.num_completed.cmp(&a.num_completed));
stats_handle.set(sorted);
}

request_finished.set(true);
}
Err(e) => {
Expand Down
2 changes: 1 addition & 1 deletion crates/client/src/pages/lens_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ pub fn lens_component(props: &LensProps) -> Html {
</div>
}
} else {
html! { <InstallButton download_url={result.download_url.clone().unwrap()} /> }
html! { <InstallButton download_url={result.download_url.clone().expect("Invalid lens download URL")} /> }
};

let view_link = if result.html_url.is_some() {
Expand Down
42 changes: 29 additions & 13 deletions crates/client/src/pages/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pub enum ResultDisplay {

#[derive(Clone, Debug)]
pub enum Msg {
ClearFilters,
ClearQuery,
ClearResults,
Focus,
Expand Down Expand Up @@ -109,7 +110,7 @@ impl SearchPage {
fn request_resize(&self) {
if let Some(node) = self.search_wrapper_ref.cast::<HtmlElement>() {
spawn_local(async move {
resize_window(node.offset_height() as f64).await.unwrap();
let _ = resize_window(node.offset_height() as f64).await;
});
}
}
Expand Down Expand Up @@ -139,7 +140,11 @@ impl Component for SearchPage {
let link = link.clone();
spawn_local(async move {
let cb = Closure::wrap(Box::new(move |_| {
link.send_message(Msg::ClearQuery);
link.send_message_batch(vec![
Msg::ClearFilters,
Msg::ClearResults,
Msg::ClearQuery,
]);
}) as Box<dyn Fn(JsValue)>);

let _ = listen(ClientEvent::ClearSearch.as_ref(), &cb).await;
Expand Down Expand Up @@ -176,19 +181,23 @@ impl Component for SearchPage {
fn update(&mut self, ctx: &Context<Self>, msg: Self::Message) -> bool {
let link = ctx.link();
match msg {
Msg::ClearFilters => {
self.lens.clear();
true
}
Msg::ClearResults => {
self.selected_idx = 0;
self.docs_results = Vec::new();
self.lens_results = Vec::new();
self.docs_results.clear();
self.lens_results.clear();
self.search_meta = None;
self.result_display = ResultDisplay::None;
self.request_resize();
true
}
Msg::ClearQuery => {
self.selected_idx = 0;
self.docs_results = Vec::new();
self.lens_results = Vec::new();
self.docs_results.clear();
self.lens_results.clear();
self.search_meta = None;
self.query = "".to_string();
if let Some(el) = self.search_input_ref.cast::<HtmlInputElement>() {
Expand All @@ -199,14 +208,14 @@ impl Component for SearchPage {
true
}
Msg::Focus => {
if let Some(el) = self.search_input_ref.cast::<HtmlElement>() {
if let Some(el) = self.search_input_ref.cast::<HtmlInputElement>() {
let _ = el.focus();
}
self.request_resize();
true
}
Msg::HandleError(msg) => {
let window = window().unwrap();
let window = window().expect("Unable to get window");
let _ = window.alert_with_message(&msg);
false
}
Expand Down Expand Up @@ -306,9 +315,12 @@ impl Component for SearchPage {
let query = self.query.clone();

link.send_future(async move {
match search_docs(serde_wasm_bindgen::to_value(&lenses).unwrap(), query).await {
Ok(results) => match serde_wasm_bindgen::from_value(results) {
Ok(deser) => Msg::UpdateDocsResults(deser),
match serde_wasm_bindgen::to_value(&lenses) {
Ok(lenses) => match search_docs(lenses, query).await {
Ok(results) => match serde_wasm_bindgen::from_value(results) {
Ok(deser) => Msg::UpdateDocsResults(deser),
Err(e) => Msg::HandleError(format!("Error: {:?}", e)),
},
Err(e) => Msg::HandleError(format!("Error: {:?}", e)),
},
Err(e) => Msg::HandleError(format!("Error: {:?}", e)),
Expand Down Expand Up @@ -436,17 +448,21 @@ impl Component for SearchPage {
};

html! {
<div ref={self.search_wrapper_ref.clone()} class="relative overflow-hidden rounded-xl border-neutral-600 border">
<div ref={self.search_wrapper_ref.clone()}
class="relative overflow-hidden rounded-xl border-neutral-600 border"
onclick={link.callback(|_| Msg::Focus)}
>
<div class="flex flex-nowrap w-full">
<SelectedLens lens={self.lens.clone()} />
<input
ref={self.search_input_ref.clone()}
id="searchbox"
type="text"
class="bg-neutral-800 text-white text-5xl py-4 px-6 overflow-hidden flex-1 outline-none active:outline-none focus:outline-none"
class="bg-neutral-800 text-white text-5xl py-4 px-6 overflow-hidden flex-1 outline-none active:outline-none focus:outline-none caret-white"
placeholder="Search"
onkeyup={link.callback(Msg::KeyboardEvent)}
onkeydown={link.callback(Msg::KeyboardEvent)}
onclick={link.callback(|_| Msg::Focus)}
spellcheck="false"
tabindex="-1"
/>
Expand Down
Loading

0 comments on commit 9668a88

Please sign in to comment.