-
Notifications
You must be signed in to change notification settings - Fork 3.1k
feat: implement reusable useAutoSave hook for inline editing (#694) #724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
jonahgabriel
wants to merge
5
commits into
coleam00:main
from
jonahgabriel:feat/useAutoSave-hook-issue-694
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d45a077
feat: implement generic useAutoSave hook with TypeScript support and β¦
6914ca5
fix: resolve timing issues in useAutoSave tests
03a30a4
feat: implement reusable useAutoSave hook for inline editing (#694)
jonahgabriel f4065aa
feat: remove Knowledge-specific useKnowledgeAutoSave wrapper
jonahgabriel 5fef8fe
fix: address CodeRabbit feedback on PR #724
jonahgabriel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ["meta.json"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,342 @@ | ||
| { | ||
| "index_settings": { | ||
| "docstore_compression": "lz4", | ||
| "docstore_blocksize": 16384 | ||
| }, | ||
| "segments": [], | ||
| "schema": [ | ||
| { | ||
| "name": "doc_type", | ||
| "type": "text", | ||
| "options": { | ||
| "indexing": { | ||
| "record": "basic", | ||
| "fieldnorms": true, | ||
| "tokenizer": "raw" | ||
| }, | ||
| "stored": true, | ||
| "fast": true | ||
| } | ||
| }, | ||
| { | ||
| "name": "symbol_id", | ||
| "type": "u64", | ||
| "options": { | ||
| "indexed": true, | ||
| "fieldnorms": false, | ||
| "fast": true, | ||
| "stored": true | ||
| } | ||
| }, | ||
| { | ||
| "name": "file_path", | ||
| "type": "text", | ||
| "options": { | ||
| "indexing": { | ||
| "record": "basic", | ||
| "fieldnorms": true, | ||
| "tokenizer": "raw" | ||
| }, | ||
| "stored": true, | ||
| "fast": false | ||
| } | ||
| }, | ||
| { | ||
| "name": "line_number", | ||
| "type": "u64", | ||
| "options": { | ||
| "indexed": false, | ||
| "fieldnorms": false, | ||
| "fast": true, | ||
| "stored": true | ||
| } | ||
| }, | ||
| { | ||
| "name": "column", | ||
| "type": "u64", | ||
| "options": { | ||
| "indexed": false, | ||
| "fieldnorms": false, | ||
| "fast": false, | ||
| "stored": true | ||
| } | ||
| }, | ||
| { | ||
| "name": "name", | ||
| "type": "text", | ||
| "options": { | ||
| "indexing": { | ||
| "record": "position", | ||
| "fieldnorms": true, | ||
| "tokenizer": "default" | ||
| }, | ||
| "stored": true, | ||
| "fast": false | ||
| } | ||
| }, | ||
| { | ||
| "name": "doc_comment", | ||
| "type": "text", | ||
| "options": { | ||
| "indexing": { | ||
| "record": "position", | ||
| "fieldnorms": true, | ||
| "tokenizer": "default" | ||
| }, | ||
| "stored": true, | ||
| "fast": false | ||
| } | ||
| }, | ||
| { | ||
| "name": "signature", | ||
| "type": "text", | ||
| "options": { | ||
| "indexing": { | ||
| "record": "position", | ||
| "fieldnorms": true, | ||
| "tokenizer": "default" | ||
| }, | ||
| "stored": true, | ||
| "fast": false | ||
| } | ||
| }, | ||
| { | ||
| "name": "context", | ||
| "type": "text", | ||
| "options": { | ||
| "indexing": { | ||
| "record": "position", | ||
| "fieldnorms": true, | ||
| "tokenizer": "default" | ||
| }, | ||
| "stored": true, | ||
| "fast": false | ||
| } | ||
| }, | ||
| { | ||
| "name": "module_path", | ||
| "type": "text", | ||
| "options": { | ||
| "indexing": { | ||
| "record": "basic", | ||
| "fieldnorms": true, | ||
| "tokenizer": "raw" | ||
| }, | ||
| "stored": true, | ||
| "fast": false | ||
| } | ||
| }, | ||
| { | ||
| "name": "kind", | ||
| "type": "text", | ||
| "options": { | ||
| "indexing": { | ||
| "record": "basic", | ||
| "fieldnorms": true, | ||
| "tokenizer": "raw" | ||
| }, | ||
| "stored": true, | ||
| "fast": false | ||
| } | ||
| }, | ||
| { | ||
| "name": "visibility", | ||
| "type": "u64", | ||
| "options": { | ||
| "indexed": false, | ||
| "fieldnorms": false, | ||
| "fast": false, | ||
| "stored": true | ||
| } | ||
| }, | ||
| { | ||
| "name": "scope_context", | ||
| "type": "text", | ||
| "options": { | ||
| "indexing": { | ||
| "record": "basic", | ||
| "fieldnorms": true, | ||
| "tokenizer": "raw" | ||
| }, | ||
| "stored": true, | ||
| "fast": false | ||
| } | ||
| }, | ||
| { | ||
| "name": "language", | ||
| "type": "text", | ||
| "options": { | ||
| "indexing": { | ||
| "record": "basic", | ||
| "fieldnorms": true, | ||
| "tokenizer": "raw" | ||
| }, | ||
| "stored": true, | ||
| "fast": true | ||
| } | ||
| }, | ||
| { | ||
| "name": "from_symbol_id", | ||
| "type": "u64", | ||
| "options": { | ||
| "indexed": true, | ||
| "fieldnorms": false, | ||
| "fast": true, | ||
| "stored": true | ||
| } | ||
| }, | ||
| { | ||
| "name": "to_symbol_id", | ||
| "type": "u64", | ||
| "options": { | ||
| "indexed": true, | ||
| "fieldnorms": false, | ||
| "fast": true, | ||
| "stored": true | ||
| } | ||
| }, | ||
| { | ||
| "name": "relation_kind", | ||
| "type": "text", | ||
| "options": { | ||
| "indexing": { | ||
| "record": "basic", | ||
| "fieldnorms": true, | ||
| "tokenizer": "raw" | ||
| }, | ||
| "stored": true, | ||
| "fast": true | ||
| } | ||
| }, | ||
| { | ||
| "name": "relation_weight", | ||
| "type": "f64", | ||
| "options": { | ||
| "indexed": false, | ||
| "fieldnorms": false, | ||
| "fast": false, | ||
| "stored": true | ||
| } | ||
| }, | ||
| { | ||
| "name": "relation_line", | ||
| "type": "u64", | ||
| "options": { | ||
| "indexed": false, | ||
| "fieldnorms": false, | ||
| "fast": false, | ||
| "stored": true | ||
| } | ||
| }, | ||
| { | ||
| "name": "relation_column", | ||
| "type": "u64", | ||
| "options": { | ||
| "indexed": false, | ||
| "fieldnorms": false, | ||
| "fast": false, | ||
| "stored": true | ||
| } | ||
| }, | ||
| { | ||
| "name": "relation_context", | ||
| "type": "text", | ||
| "options": { | ||
| "indexing": { | ||
| "record": "position", | ||
| "fieldnorms": true, | ||
| "tokenizer": "default" | ||
| }, | ||
| "stored": true, | ||
| "fast": false | ||
| } | ||
| }, | ||
| { | ||
| "name": "file_id", | ||
| "type": "u64", | ||
| "options": { | ||
| "indexed": true, | ||
| "fieldnorms": false, | ||
| "fast": true, | ||
| "stored": true | ||
| } | ||
| }, | ||
| { | ||
| "name": "file_hash", | ||
| "type": "text", | ||
| "options": { | ||
| "indexing": { | ||
| "record": "basic", | ||
| "fieldnorms": true, | ||
| "tokenizer": "raw" | ||
| }, | ||
| "stored": true, | ||
| "fast": false | ||
| } | ||
| }, | ||
| { | ||
| "name": "file_timestamp", | ||
| "type": "u64", | ||
| "options": { | ||
| "indexed": false, | ||
| "fieldnorms": false, | ||
| "fast": true, | ||
| "stored": true | ||
| } | ||
| }, | ||
| { | ||
| "name": "meta_key", | ||
| "type": "text", | ||
| "options": { | ||
| "indexing": { | ||
| "record": "basic", | ||
| "fieldnorms": true, | ||
| "tokenizer": "raw" | ||
| }, | ||
| "stored": true, | ||
| "fast": true | ||
| } | ||
| }, | ||
| { | ||
| "name": "meta_value", | ||
| "type": "u64", | ||
| "options": { | ||
| "indexed": false, | ||
| "fieldnorms": false, | ||
| "fast": true, | ||
| "stored": true | ||
| } | ||
| }, | ||
| { | ||
| "name": "cluster_id", | ||
| "type": "u64", | ||
| "options": { | ||
| "indexed": false, | ||
| "fieldnorms": false, | ||
| "fast": true, | ||
| "stored": true | ||
| } | ||
| }, | ||
| { | ||
| "name": "vector_id", | ||
| "type": "u64", | ||
| "options": { | ||
| "indexed": false, | ||
| "fieldnorms": false, | ||
| "fast": true, | ||
| "stored": true | ||
| } | ||
| }, | ||
| { | ||
| "name": "has_vector", | ||
| "type": "u64", | ||
| "options": { | ||
| "indexed": false, | ||
| "fieldnorms": false, | ||
| "fast": true, | ||
| "stored": true | ||
| } | ||
| } | ||
| ], | ||
| "opstamp": 0 | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π οΈ Refactor suggestion
π§© Analysis chain
Avoid committing generated Tantivy index artifacts
meta.jsonlooks like a runtimeβgenerated Tantivy index metadata file (opstamp, segments). Committing this will create constant churn and merge conflicts. Prefer ignoring.codanna/index/**and generating the index at build/runtime. If you intend to version a schema, extract a stableschema.jsononly.Apply ignore rules and remove the tracked file:
Run to verify ignore and tracked files:
π Script executed:
Length of output: 318
Remove generated Tantivy index artifacts and ignore .codanna/
Tracked files: .codanna/index/tantivy/.managed.json, .codanna/index/tantivy/meta.json β these are runtime-generated; add ignore rules and stop tracking them.
Commands to untrack and commit:
git rm -r --cached .codanna
git commit -m "chore: stop tracking generated codanna index artifacts"
π€ Prompt for AI Agents