Open ltfschoen opened 1 year ago
currently getting errors like the following when i try updating the "details" table a few times. it's also updating 'main' in localstorage instead of 'details' key
Uncaught RuntimeError: memory access out of bounds
at __wbindgen_describe___wbg_onwebkitanimationend_dc7fa17c9bb3d099 (gen_Window.rs:4)
at _$LT$kobold..list..List$LT$T$GT$$u20$as$u20$kobold..View$GT$::update::h2b41b999ffff549b (list.rs:67)
at __wbindgen_describe___wbg_setonwebkittransitionend_0bf670694051a5f2 (gen_Window.rs:4)
at wasm_bindgen::describe::inform::h1d4130bc30aa8346 (describe.rs:53)
at __wbindgen_describe___wbg_onwebkitanimationstart_d5dde6955c300832 (gen_Window.rs:4)
at fast_qr::compact::CompactQR::push_u8::h737e828197cd41d4 (compact.rs:156)
at fast_qr::compact::CompactQR::push_bits::hdd53cfa98552c26d (compact.rs:197)
at fast_qr::encode::encode_numeric::encode_number::h4aed989c5b47f87d (encode.rs:69)
at _$LT$core..str..iter..Chars$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::h13225b9c692b5ae1 (iter.rs:44)
at _$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$::next::h9cc018efeec93740 (pattern.rs:1079)
at core::ptr::read::heb129bd681cea205 (mod.rs:1158)
at core::mem::transmute_copy::hd8719058fc1c85b7 (mod.rs:1063)
at console_error_panic_hook::hook_impl::h6677313f5d604aac (lib.rs:112)
at fast_qr::datamasking::mask_5_6::hbcce44575688bf6e (datamasking.rs:115)
at kobold_invoice.js:129:45
$_ZN8dlmalloc8dlmalloc5Chunk33set_size_and_pinuse_of_free_chunk17h9a71603b7f779266E @ gen_Window.rs:4
$_ZN8dlmalloc8dlmalloc17Dlmalloc$LT$A$GT$4free17h3c328ae7ee80e465E @ list.rs:67
$__rdl_dealloc @ gen_Window.rs:4
$__rust_dealloc @ describe.rs:53
$_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$10deallocate17h36ef018e6a61c91aE @ compact.rs:156
$_ZN5alloc5alloc8box_free17h6e91f12b737fcd30E @ iter.rs:44
$_ZN4core3ptr165drop_in_place$LT$alloc..boxed..Box$LT$dyn$u20$core..ops..function..Fn$LT$$LP$web_sys..features..gen_Event..Event$C$$RP$$GT$$u2b$Output$u20$$u3d$$u20$$LP$$RP$$GT$$GT$17ha448bf1c2f11e487E @ mod.rs:1158
$_ZN4core3mem4drop17h2c037c55273e5525E @ lib.rs:112
$_ZN133_$LT$dyn$u20$core..ops..function..Fn$LT$$LP$A$C$$RP$$GT$$u2b$Output$u20$$u3d$$u20$R$u20$as$u20$wasm_bindgen..closure..WasmClosure$GT$8describe7destroy17hf6ab3bf8da6b9a64E @ datamasking.rs:115
(anonymous) @ kobold_invoice.js:129
kobold_invoice.js:102 Uncaught TypeError: Failed to execute 'decode' on 'TextDecoder': The encoded data was not valid.
at getStringFromWasm0 (kobold_invoice.js:102:30)
at imports.wbg.__wbg_createTextNode_2112894c86841cbb (kobold_invoice.js:364:45)
at fast_qr::default::create_matrix_alignments::hcee1ddb1085e5459 (default.rs:149)
at _ZN76_$LT$$RF$kobold..diff..Ref$LT$str$GT$$u20$as$u20$kobold..value..IntoText$GT$9into_text17hb11f50f01c8b6fabE (kobold_invoice_bg.wasm:0xb479e)
at fast_qr::default::create_matrix_alignments::hcee1ddb1085e5459 (kobold_invoice_bg.wasm:0xad553)
at fast_qr::polynomials::structure::hb4b1448fb5c928fe (polynomials.rs:129)
at _$LT$kobold..list..List$LT$T$GT$$u20$as$u20$kobold..View$GT$::update::h9fa55b396af89e38 (list.rs:66)
at _$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::hdfa3ff59ae353b75 (macros.rs:142)
at alloc::vec::Vec$LT$T$C$A$GT$::push::ha74b3facff6165fb (mod.rs:1844)
at wasm_logger::Style::new::h729c9f0071af9b02 (lib.rs:80)
mod.rs:2637 Uncaught RuntimeError: memory access out of bounds
at _$LT$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$core..ops..deref..Deref$GT$::deref::h23ff83151ef2245b (mod.rs:2637)
at wasm_bindgen_futures::task::singlethread::Task::into_raw_waker::raw_wake_by_ref::h40c29e0c999635df (singlethread.rs:72)
at __wbindgen_describe___wbg_ontransitionstart_9c839e3817f89ed7 (gen_Window.rs:4)
at __wbindgen_describe___wbg_ontransitionend_d3cd710b8bede9b4 (gen_Window.rs:4)
at fast_qr::datamasking::mask_vertical::hcf9f883b6f47a9e4 (datamasking.rs:59)
at _$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$::allocate::h700939757b68bd88 (alloc.rs:238)
at passStringToWasm0 (kobold_invoice.js:56:15)
at imports.wbg.__wbg_value_1f2c9e357d18d3ea (kobold_invoice.js:475:22)
at fast_qr::default::create_matrix_pattern::h3b5a361121530954 (default.rs:95)
at _ZN4main11CellDetails6render28_$u7b$$u7b$closure$u7d$$u7d$17hdf11d6f6d856e2c8E (kobold_invoice_bg.wasm:0x6aa6f)
still getting this error
caught TypeError: Failed to execute 'decode' on 'TextDecoder': The encoded data was not valid.
at getStringFromWasm0 (kobold_invoice.js:101:30)
at imports.wbg.__wbg_createTextNode_2112894c86841cbb (kobold_invoice.js:359:45)
at _ZN6kobold8internal9text_node17hf527cb86fc09f751E (kobold_invoice_bg.wasm:0xb1f43)
at _ZN76_$LT$$RF$kobold..diff..Ref$LT$str$GT$$u20$as$u20$kobold..value..IntoText$GT$9into_text17hb11f50f01c8b6fabE (kobold_invoice_bg.wasm:0xb9c96)
at _ZN6kobold5value75_$LT$impl$u20$kobold..View$u20$for$u20$$RF$kobold..diff..Ref$LT$str$GT$$GT$5build17hc79066080ace3d1aE (kobold_invoice_bg.wasm:0xb250d)
at _ZN90_$LT$main..CellDetails..render..Transient$LT$A$C$B$C$C$C$D$GT$$u20$as$u20$kobold..View$GT$5build17ha5cd21fc310d18d6E (kobold_invoice_bg.wasm:0x5e005)
at _ZN76_$LT$kobold..branching..Branch3$LT$A$C$B$C$C$GT$$u20$as$u20$kobold..View$GT$5build17h7be55d1abd4d7c1eE (kobold_invoice_bg.wasm:0x3a263)
at _ZN76_$LT$kobold..branching..Branch3$LT$A$C$B$C$C$GT$$u20$as$u20$kobold..View$GT$6update17h6db0a7bfa14dce1aE (kobold_invoice_bg.wasm:0x28bc0)
at _ZN60_$LT$kobold..list..List$LT$T$GT$$u20$as$u20$kobold..View$GT$6update17h3c2634767df87a0dE (kobold_invoice_bg.wasm:0x1f341)
at _ZN138_$LT$main..Editor..render..$u7b$$u7b$closure$u7d$$u7d$..Transient$LT$A$C$B$C$C$C$D$C$E$C$F$C$G$C$H$C$I$C$J$GT$$u20$as$u20$kobold..View$GT$6update17hfde0f0b174b24a61E (kobold_invoice_bg.wasm:0x5ea7d)
g
it panics when i try to write to details.csv file in this commit https://github.com/maciejhirsz/kobold/pull/57/commits/6862305cb2b9d93b76b50223c1835077cbf34972
nicked at 'failed to write to file "details.csv"', examples/invoice/src/main.rs:96:29
Stack:
Error
at imports.wbg.__wbg_new_abda76e883ba8a5f (http://localhost:8080/kobold_invoice.js:408:21)
at _ZN24console_error_panic_hook5Error3new17h8eca147a7ff63dbdE (http://localhost:8080/kobold_invoice_bg.wasm:wasm-function[2855]:0xf1824)
at _ZN24console_error_panic_hook9hook_impl17h6677313f5d604aacE (http://localhost:8080/kobold_invoice_bg.wasm:wasm-function[541]:0x974c2)
at _ZN24console_error_panic_hook4hook17h857f5ab07d6635a4E (http://localhost:8080/kobold_invoice_bg.wasm:wasm-function[3265]:0xf707d)
at _ZN4core3ops8function2Fn4call17ha81acb5c88143e67E (http://localhost:8080/kobold_invoice_bg.wasm:wasm-function[2744]:0xefcb7)
at _ZN3std9panicking20rust_panic_with_hook17hc53aea0352e77326E (http://localhost:8080/kobold_invoice_bg.wasm:wasm-function[1170]:0xc38de)
at _ZN3std9panicking19begin_panic_handler28_$u7b$$u7b$closure$u7d$$u7d$17ha183a8279614f03aE (http://localhost:8080/kobold_invoice_bg.wasm:wasm-function[1453]:0xd04a9)
at _ZN3std10sys_common9backtrace26__rust_end_short_backtrace17hc33870f333461503E (http://localhost:8080/kobold_invoice_bg.wasm:wasm-function[3363]:0xf841b)
at rust_begin_unwind (http://localhost:8080/kobold_invoice_bg.wasm:wasm-function[2288]:0xe77bd)
at _ZN4core9panicking9panic_fmt17hf4a9df75710ece83E (http://localhost:8080/kobold_invoice_bg.wasm:wasm-function[3126]:0xf542b)
imports.wbg.__wbg_error_f851667af71bcfc6 @ kobold_invoice.js:402
$_ZN24console_error_panic_hook5error17hfdb5d3aa6b4b9644E @ kobold_invoice_bg.wasm:0xcdc85
$_ZN24console_error_panic_hook9hook_impl17h6677313f5d604aacE @ kobold_invoice_bg.wasm:0x975ae
$_ZN24console_error_panic_hook4hook17h857f5ab07d6635a4E @ kobold_invoice_bg.wasm:0xf707d
$_ZN4core3ops8function2Fn4call17ha81acb5c88143e67E @ kobold_invoice_bg.wasm:0xefcb7
$_ZN3std9panicking20rust_panic_with_hook17hc53aea0352e77326E @ kobold_invoice_bg.wasm:0xc38de
$_ZN3std9panicking19begin_panic_handler28_$u7b$$u7b$closure$u7d$$u7d$17ha183a8279614f03aE @ kobold_invoice_bg.wasm:0xd04a9
$_ZN3std10sys_common9backtrace26__rust_end_short_backtrace17hc33870f333461503E @ kobold_invoice_bg.wasm:0xf841b
$rust_begin_unwind @ kobold_invoice_bg.wasm:0xe77bd
$_ZN4core9panicking9panic_fmt17hf4a9df75710ece83E @ kobold_invoice_bg.wasm:0xf542b
$_ZN4main6Editor6render28_$u7b$$u7b$closure$u7d$$u7d$28_$u7b$$u7b$closure$u7d$$u7d$28_$u7b$$u7b$closure$u7d$$u7d$17h84605ef1d88744abE @ kobold_invoice_bg.wasm:0x506ee
$_ZN20wasm_bindgen_futures4task12singlethread4Task3run17h6541d8fca9444d8eE @ kobold_invoice_bg.wasm:0x87b25
$_ZN20wasm_bindgen_futures5queue10QueueState7run_all17h608e4a45f4a3666aE @ kobold_invoice_bg.wasm:0x76c97
$_ZN20wasm_bindgen_futures5queue5Queue3new28_$u7b$$u7b$closure$u7d$$u7d$17hf58ca1d565391e21E @ kobold_invoice_bg.wasm:0xd8909
$_ZN136_$LT$dyn$u20$core..ops..function..FnMut$LT$$LP$A$C$$RP$$GT$$u2b$Output$u20$$u3d$$u20$R$u20$as$u20$wasm_bindgen..closure..WasmClosure$GT$8describe6invoke17h6dc730a2f40af342E @ kobold_invoice_bg.wasm:0xc4987
__wbg_adapter_19 @ kobold_invoice.js:181
real @ kobold_invoice.js:166
Promise.then (async)
imports.wbg.__wbg_then_ec5db6d509eb475f @ kobold_invoice.js:541
$_ZN6js_sys7Promise4then17h0cded4148d2751e2E @ kobold_invoice_bg.wasm:0xe0445
$_ZN20wasm_bindgen_futures5queue5Queue13schedule_task17hccaa2aee91f46ba1E @ kobold_invoice_bg.wasm:0x9c454
$_ZN20wasm_bindgen_futures4task12singlethread4Task5spawn28_$u7b$$u7b$closure$u7d$$u7d$17h5a1525015b97f5b8E @ kobold_invoice_bg.wasm:0xf1686
$_ZN3std6thread5local17LocalKey$LT$T$GT$8try_with17h5b2057ce81d29d22E @ kobold_invoice_bg.wasm:0x9fc45
$_ZN3std6thread5local17LocalKey$LT$T$GT$4with17h980046e8c0454f9bE @ kobold_invoice_bg.wasm:0xca5a1
$_ZN20wasm_bindgen_futures4task12singlethread4Task5spawn17hfc2e0a5e8737a3c0E @ kobold_invoice_bg.wasm:0x76141
$_ZN20wasm_bindgen_futures11spawn_local17h184997ae31f7e4e5E @ kobold_invoice_bg.wasm:0xccfeb
$_ZN4main6Editor6render28_$u7b$$u7b$closure$u7d$$u7d$28_$u7b$$u7b$closure$u7d$$u7d$17hf9635ef5c491ec86E @ kobold_invoice_bg.wasm:0xcd9c5
$_ZN133_$LT$dyn$u20$core..ops..function..Fn$LT$$LP$A$C$$RP$$GT$$u2b$Output$u20$$u3d$$u20$R$u20$as$u20$wasm_bindgen..closure..WasmClosure$GT$8describe6invoke17hfeff662c4233db8bE @ kobold_invoice_bg.wasm:0xc6d0a
__wbg_adapter_16 @ kobold_invoice.js:153
real @ kobold_invoice.js:139
kobold_invoice_bg.wasm:0xfa841 Uncaught (in promise) RuntimeError: unreachable
at __rust_start_panic (kobold_invoice_bg.wasm:0xfa841)
at rust_panic (kobold_invoice_bg.wasm:0xf8dff)
at _ZN3std9panicking20rust_panic_with_hook17hc53aea0352e77326E (kobold_invoice_bg.wasm:0xc3909)
at _ZN3std9panicking19begin_panic_handler28_$u7b$$u7b$closure$u7d$$u7d$17ha183a8279614f03aE (kobold_invoice_bg.wasm:0xd04a9)
at _ZN3std10sys_common9backtrace26__rust_end_short_backtrace17hc33870f333461503E (kobold_invoice_bg.wasm:0xf841b)
at rust_begin_unwind (kobold_invoice_bg.wasm:0xe77bd)
at _ZN4core9panicking9panic_fmt17hf4a9df75710ece83E (kobold_invoice_bg.wasm:0xf542b)
at _ZN4main6Editor6render28_$u7b$$u7b$closure$u7d$$u7d$28_$u7b$$u7b$closure$u7d$$u7d$28_$u7b$$u7b$closure$u7d$$u7d$17h84605ef1d88744abE (kobold_invoice_bg.wasm:0x506ee)
at _ZN20wasm_bindgen_futures4task12singlethread4Task3run17h6541d8fca9444d8eE (kobold_invoice_bg.wasm:0x87b25)
at _ZN20wasm_bindgen_futures5queue10QueueState7run_all17h608e4a45f4a3666aE (kobold_invoice_bg.wasm:0x76c97)
$
Fix broken code after updating from Kobold 0.7.0 to 0.8.0. See https://github.com/maciejhirsz/kobold/pull/57/commits/7cfcfcbd0a910d2187f0de470e4a1de90bb2db61
onsave_details
method when uncommented doesn't let me compile the code at all and gives below error even though it looks the same as the other functions that work:
error[E0609]: no field `details` on type `Signal<state::State>`
--> examples/invoice/src/main.rs:59:55
|
59 | debug!("onsave_details: {:?}", &state.details);
| ^^^^^^^ unknown field
error[E0609]: no field details
on type Signal<state::State>
--> examples/invoice/src/main.rs:61:74
|
61 | match csv::generate_csv_data_obj_url_for_download(&state.details).await {
| ^^^^^^^ unknown field
error[E0609]: no field details
on type Signal<state::State>
--> examples/invoice/src/main.rs:75:70
|
75 | panic!("failed to write to file {:?}", state.details.filename);
| ^^^^^^^ unknown field
error[E0609]: no field details
on type Signal<state::State>
--> examples/invoice/src/main.rs:78:65
|
78 | debug!("successfully wrote to file {:?}", state.details.filename);
| ^^^^^^^ unknown field
* if i comment out `onsave_details` it compiles, but in the UI when i click the button "Upload CSV File" and choose the file "details.csv", the browser console crashes with the following error:
kobold_invoice.js:469 panicked at 'assertion failed: !self.borrowed.get()', /Users/luke/code/github/ltfschoen/kobold/crates/kobold/src/stateful/cell.rs:34:9
Stack:
Error at imports.wbg.__wbg_new_abda76e883ba8a5f (http://localhost:8080/kobold_invoice.js:475:21) at console_error_panic_hook::Error::new::h8eca147a7ff63dbd (http://localhost:8080/kobold_invoice_bg.wasm:wasm-function[2994]:0xf117e) at console_error_panic_hook::hook_impl::h6677313f5d604aac (http://localhost:8080/kobold_invoice_bg.wasm:wasm-function[547]:0x91708) at console_error_panic_hook::hook::h857f5ab07d6635a4 (http://localhost:8080/kobold_invoice_bg.wasm:wasm-function[3296]:0xf5304) at core::ops::function::Fn::call::h109e3a69924dbd42 (http://localhost:8080/kobold_invoice_bg.wasm:wasm-function[2881]:0xef579) at std::panicking::rust_panic_with_hook::hc53aea0352e77326 (http://localhost:8080/kobold_invoice_bg.wasm:wasm-function[1195]:0xbee50) at std::panicking::begin_panic_handler::{{closure}}::ha183a8279614f03a (http://localhost:8080/kobold_invoice_bg.wasm:wasm-function[1522]:0xcdaf5) at std::sys_common::backtrace::__rust_end_short_backtrace::hc33870f333461503 (http://localhost:8080/kobold_invoice_bg.wasm:wasm-function[3424]:0xf6c7d) at rust_begin_unwind (http://localhost:8080/kobold_invoice_bg.wasm:wasm-function[2405]:0xe6a09) at core::panicking::panic_fmt::hf4a9df75710ece83 (http://localhost:8080/kobold_invoice_bg.wasm:wasm-function[3208]:0xf40fe)
imports.wbg.wbg_error_f851667af71bcfc6 @ kobold_invoice.js:469
$console_error_panic_hook::error::hfdb5d3aa6b4b9644 @ kobold_invoice_bg.wasm:0xcb7b3
$console_error_panic_hook::hook_impl::h6677313f5d604aac @ kobold_invoice_bg.wasm:0x917f4
$console_error_panic_hook::hook::h857f5ab07d6635a4 @ kobold_invoice_bg.wasm:0xf5304
$core::ops::function::Fn::call::h109e3a69924dbd42 @ kobold_invoice_bg.wasm:0xef579
$std::panicking::rust_panic_with_hook::hc53aea0352e77326 @ kobold_invoice_bg.wasm:0xbee50
$std::panicking::begin_panic_handler::{{closure}}::ha183a8279614f03a @ kobold_invoice_bg.wasm:0xcdaf5
$std::sys_common::backtrace::__rust_end_short_backtrace::hc33870f333461503 @ kobold_invoice_bg.wasm:0xf6c7d
$rust_begin_unwind @ kobold_invoice_bg.wasm:0xe6a09
$core::panicking::panic_fmt::hf4a9df75710ece83 @ kobold_invoice_bg.wasm:0xf40fe
$core::panicking::panic::h54beb3f515dd3c6d @ kobold_invoice_bg.wasm:0xe980f
$kobold::stateful::cell::WithCell as core::ops::deref::Deref>::deref::h39cab567fea67e5c @ kobold_invoice_bg.wasm:0xbcd45
$main::Editor::>::update::ha9fa85be411ef177 @ kobold_invoice_bg.wasm:0xdc0e5
$kobold::stateful::Inner::update::h0672142c99ae7add @ kobold_invoice_bg.wasm:0xc3699
$kobold::stateful::hook::Signal::update::{{closure}}::h472c8d091224ed88 @ kobold_invoice_bg.wasm:0xb20e7
$kobold::stateful::cell::WithCell::update::ha93bc3d9bde766e1 @ kobold_invoice_bg.wasm:0x781b7
$main::Editor::render::{{closure}}::{{closure}}::{{closure}}::hee6695594d5820ad @ kobold_invoice_bg.wasm:0x334fe
$wasm_bindgen_futures::task::singlethread::Task::run::h6541d8fca9444d8e @ kobold_invoice_bg.wasm:0x81235
$wasm_bindgen_futures::queue::QueueState::run_all::h608e4a45f4a3666a @ kobold_invoice_bg.wasm:0x72712
$wasm_bindgen_futures::queue::Queue::new::{{closure}}::hf58ca1d565391e21 @ kobold_invoice_bg.wasm:0xd70bd
$<dyn core::ops::function::FnMut<(A,)>+Output = R as wasm_bindgen::closure::WasmClosure>::describe::invoke::h6dc730a2f40af342 @ kobold_invoice_bg.wasm:0xc1049
wbg_adapter_18 @ kobold_invoice.js:156
real @ kobold_invoice.js:141
Promise.then (async)
imports.wbg.wbg_then_ec5db6d509eb475f @ kobold_invoice.js:631
$js_sys::Promise::then::h0cded4148d2751e2 @ kobold_invoice_bg.wasm:0xdf875
$wasm_bindgen_futures::queue::Queue::schedule_task::hccaa2aee91f46ba1 @ kobold_invoice_bg.wasm:0x948f8
$wasm_bindgen_futures::task::singlethread::Task::spawn::{{closure}}::h5a1525015b97f5b8 @ kobold_invoice_bg.wasm:0xf1247
$std::thread::local::LocalKey::bind_async::{{closure}}::h383eb607fbd78bfe @ kobold_invoice_bg.wasm:0x9d008
$<kobold::event::ListenerProduct<F,E> as kobold::event::ListenerHandle>::js::{{closure}}::hebd8d453c2dade6d @ kobold_invoice_bg.wasm:0xe840f
$core::ops::function::FnOnce::call_once::h8b2b76c48241bd8d @ kobold_invoice_bg.wasm:0xe7995
$kobold::internal::hidden::kobold_callback::h961631967e554853 @ kobold_invoice_bg.wasm:0xe4e00
$koboldCallback @ kobold_invoice_bg.wasm:0xdc77e
koboldCallback @ kobold_invoice.js:241
(anonymous) @ util.js:47
kobold_invoice_bg.wasm:0xf974a Uncaught (in promise) RuntimeError: unreachable
at __rust_start_panic (kobold_invoice_bg.wasm:0xf974a)
at rust_panic (kobold_invoice_bg.wasm:0xf7ad6)
at std::panicking::rust_panic_with_hook::hc53aea0352e77326 (kobold_invoice_bg.wasm:0xbee7b)
at std::panicking::begin_panic_handler::{{closure}}::ha183a8279614f03a (kobold_invoice_bg.wasm:0xcdaf5)
at std::sys_common::backtrace:: as core::ops::deref::Deref>::deref::h39cab567fea67e5c (kobold_invoice_bg.wasm:0xbcd45)
$
run with
from_org_addr
input field in the UIfrom_org_addr
input field in the UI with multiple editable input fields with details likeinv_date
,from_org_addr
, etc (from details.csv labels. so we can choose a 'details' file details.csv to populate those input fields in the UI, whose input fields are still then editableEmpty
, try usingcondition.then(|| view! { ... })
https://doc.rust-lang.org/std/primitive.bool.html#method.then. See Discord thread "how to useEmpty
...". Update: did this to conditionally render the hint only when not already editingupdate
instead ofupdate_silent
again.onload_details
andonload_main
into common method, or move common aspects into common function. See https://github.com/maciejhirsz/kobold/commit/1cc4c97ec6859fdc025ecb20552247265ef29244. See Discord thread "how to change the onchange...". Update: This feature is only possible with nightly, might be possible in futureonchange
(until refresh or upload a different document), but the issue doesn't happen on Firefox - solved using this https://stackoverflow.com/a/48499451/3208553, in this commit https://github.com/maciejhirsz/kobold/pull/57/commits/daa517a11e44eebca0869d0aa4859ccc065a6a18onchange
to something else so if try upload same file twice in a row on Brave or Chrome, it updates#details,name,age\nluke,....
, where there is a mapping fromdetails
toTableVariant::Details
. so if they provide a valid one identified by prefix with#
at the start, then it will store that valuedetails
as theTable
's propertyvariant
value, otherwise it will error if invalid one is provided, or if it is not provided thenTableVariant::Unknown
will be stored (perhaps if loaded from mock data) unless they click the relevant button that triggers sayonload_details
, which manually overrides it withTableVariant::Details
withget(state).table.variant = table_variant;
Table
's propertyvariant
value has a value other thanTableVariant::Unknown
, so if it wasTableVariant::Details
then it'd modify the string to be downloaded so it would be prefixed with#details,
before anything else. See commit https://github.com/maciejhirsz/kobold/commit/8eb05e176ef41fbc9021997cd5d408334f5d1030HeadDetails
we useEditing::Cell { row, col }
whereas inHead
we just use(Editing::Column { col }
. In the state for "details" table we're storing thevariables
in columns, thedata
in row[0], and the labels in row[1], but we want the variables removed, the labels to be instead in row[0] and data values in row[1]. In csv.rs we're pushing the table variant prefix on the variables in details, but we're pushing the table variant prefix on the labels in main because it doesn't have any variables. it's inconsistent but it still works, but need to remove variables and only keep labels. fixed in commit https://github.com/maciejhirsz/kobold/pull/57/commits/8e1fd25edf6f58f8368c1c9f360cb7dbd696b766"description,total,qr,aaa\neat,1,0x0,\nsleep,2,0x1,"
) then pad those values so do not get errors saving. See commit https://github.com/maciejhirsz/kobold/pull/57/commits/79433ce608012cfd4231d5b9b88e59914344202fonload_common
with Maciej feedback to pass function to the function as follows:and call with
onload_common(|state| &mut state.main, state, event).await;
to duplicateonload_common
, so the closure will be inlined in the release build. also replacewith the following as they should compile to the same code with optimizations on, which is an extra layer of a state machine for the compiler to chug through:
InvalidRowLength
. but also give option to specify the table variant#main
, or#details
, we know where they should go in the UI. error if try upload two files both with same variant..... would it be cooler if they were in same file, but that's not a very organised approach#
value into aconst
, but not sure how to use the const in a regex so would have to change that manually. also wouldn't mind creating a mapping from TableVariant to string by creating a FromTableVariant that extends String, and also the other way arround. Also think i need to have higher order Error enum since some errors might have shared usage across state.rs and csv.rs files . Draft commit with TODOs here https://github.com/maciejhirsz/kobold/commit/8eb05e176ef41fbc9021997cd5d408334f5d1030Head
andHeadDetails
into single componentHead
, and combineCell
withCellDetails
into a single componentCell
. Do this by usingget: impl Fn(&mut State) -> &mut Content
instead ofstate: ...
techniqueScreenshot Preview (9 May 2023):
Screenshot Preview (8 May 2023):