- Bloodhound Initialization:
- Changed the suggestion object structure to a flattened format for Typeahead compatibility.
- Removed nested `display` structure in favor of direct `displayLabel` and `displayDescription` fields.
- Simplified the construction of suggestion objects by directly setting flattened fields.
- Typeahead Initialization:
- Enhanced logging in the JavaScript initialization script for better debugging.
- Updated the `display` function in Typeahead to use flattened fields (`displayLabel` and `displayDescription`) instead of nested `display` objects.
- Improved error handling and logging for cases where suggestions are not arrays or are empty.
- Selection Handling:
- Added detailed logging for selected suggestions in both Rust and JavaScript.
- Ensured the input field is updated with the selected suggestion's label.
- Code Cleanup:
- Removed redundant nested object creation for `display` fields in Bloodhound initialization.
- Streamlined the JavaScript initialization script for better readability and maintainability.
- Consolidated logging statements for consistent debugging output.
Changes:
* Replaced `let current_url = get_current_url();` with `let current_url = Rc::new(get_current_url());` to share the current URL between closures.
* Wrapped `add_property` and `update_item` functions in Arc to share them between closures.
* Updated `save_item_to_db` function to take `current_url` as an argument and use it to construct the ItemToSend struct.
* Updated `fetch_property_labels` function to use the `property_ids` vector instead of a single property ID.
* Updated `fetch_item_properties` function to use the `wikidata_id` parameter instead of a hardcoded value.
* Updated `WikidataResponse` struct to use a `Vec<WikidataSuggestion>` instead of a single `WikidataSuggestion`.
- Refactor `fetch_item_properties` to handle nested JSON types efficiently
- Introduce `parse_property_value` for structured processing of various value types
- Handle time values with varying precision (year, month, day)
- Parse and format dates from RFC 3339 format
- Support fetching and displaying labels for Wikidata entity references
- Replace raw JSON object handling with cleaner structured parsing
- Update property label fetching and signal updates for better UI data synchronization