Browse Source

implement item-wise history deletion

main
familyfriendlymikey 2 years ago
parent
commit
f5b3fb0a57
  1. 4
      app/api.imba
  2. 9
      app/components/app-bang.imba
  3. 2
      app/db.imba

4
app/api.imba

@ -257,7 +257,9 @@ export default new class api
catch e
err "updating bang history", e
def delete_bang_history_item text
def delete_bang_history_item
let text = sorted_bang_history[state.bang_selection_index]
return unless text
let i = bang.history.indexOf(text)
return unless i > -1
bang.history.splice(i, 1)

9
app/components/app-bang.imba

@ -23,6 +23,15 @@ tag app-bang
<.tip-hotkey> "Return"
<.tip-content> "Search"
if state.bang_selection_index > -1
result.push <>
<.tip
@click=api.delete_bang_history_item
@hotkey('shift+backspace').capture.if(!state.loading)=api.delete_bang_history_item
>
<.tip-hotkey> "Shift + Backspace"
<.tip-content> "Delete History Item"
result.push <>
<.tip.ellipsis
@click=api.handle_add_link

2
app/db.imba

@ -31,7 +31,7 @@ db.version(3).stores({
link.url = api.parse_url(link.url).href
db.version(4).stores({
links: "++id,display_name,name,is_bang,is_pinned,url,frequency,icon"
links: "++id,display_name,name,is_bang,is_pinned,url,frequency,history,icon"
}).upgrade! do |trans|
p "upgrading to fuzzyhome db version 4"
trans.links.toCollection!.modify! do |link|

Loading…
Cancel
Save