From 77e800feaafde95019c0d07082017adc0982202d Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 12 Nov 2017 18:37:36 +0900 Subject: [PATCH 1/3] fix QA for 0.5 --- QA.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/QA.md b/QA.md index d495aa8..c1f413d 100644 --- a/QA.md +++ b/QA.md @@ -27,8 +27,11 @@ The behaviors of the console are tested in [Console section](#consoles). - [ ] d: delete current tab - [ ] u: reopen close tab - [ ] K, J: select prev and next tab +- [ ] g0, g$: select first and last tab - [ ] r: reload current tab - [ ] R: reload current tab without cache +- [ ] zd: duplicate current tab +- [ ] zp: toggle pin/unpin state on current tab #### Navigation @@ -141,6 +144,17 @@ The behaviors of the console are tested in [Console section](#consoles). - [ ] Fucus text box on Twitter or Slack, press j, then j is typed in the box - [ ] Focus the text box on Twitter or Slack on following mode +## Find mode + +- [ ] open console with / +- [ ] highlight a word on Enter pressed in find console +- [ ] Search next/prev by n/N +- [ ] Wrap search by n/N +- [ ] Find with last keyword if keyword is empty + ## Misc - [ ] Work after plugin reload +- [ ] Work on `about:blank` +- [ ] Able to map `` key. +- [ ] Open file menu by Alt+F (Other than Mac OS) From 91ea58008c2d7e64ffca4acf20749c8f7b3eb211 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 12 Nov 2017 22:16:25 +0900 Subject: [PATCH 2/3] fix 0/$ --- src/content/scrolls.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/scrolls.js b/src/content/scrolls.js index d88320f..ef38273 100644 --- a/src/content/scrolls.js +++ b/src/content/scrolls.js @@ -104,14 +104,14 @@ const scrollBottom = (win) => { const scrollHome = (win) => { let target = scrollTarget(win); let x = 0; - let y = target.scrollLeft; + let y = target.scrollTop; target.scrollTo(x, y); }; const scrollEnd = (win) => { let target = scrollTarget(win); let x = target.scrollWidth; - let y = target.scrollLeft; + let y = target.scrollTop; target.scrollTo(x, y); }; From c202ab052917794b7d3f7af3413d2d0fcd1b3bba Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Mon, 13 Nov 2017 19:44:19 +0900 Subject: [PATCH 3/3] fix hot-reload settings --- src/content/actions/setting.js | 7 +++---- src/content/components/common/keymapper.js | 2 +- src/content/reducers/setting.js | 3 ++- test/content/actions/setting.test.js | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/content/actions/setting.js b/src/content/actions/setting.js index 353dd24..0238c71 100644 --- a/src/content/actions/setting.js +++ b/src/content/actions/setting.js @@ -2,21 +2,20 @@ import actions from 'content/actions'; import * as keyUtils from 'shared/utils/keys'; const set = (value) => { - let maps = new Map(); + let entries = []; if (value.keymaps) { - let entries = Object.entries(value.keymaps).map((entry) => { + entries = Object.entries(value.keymaps).map((entry) => { return [ keyUtils.fromMapKeys(entry[0]), entry[1], ]; }); - maps = new Map(entries); } return { type: actions.SETTING_SET, value: Object.assign({}, value, { - keymaps: maps, + keymaps: entries, }) }; }; diff --git a/src/content/components/common/keymapper.js b/src/content/components/common/keymapper.js index 0abbc91..fb8fabe 100644 --- a/src/content/components/common/keymapper.js +++ b/src/content/components/common/keymapper.js @@ -25,7 +25,7 @@ export default class KeymapperComponent { let state = this.store.getState(); let input = state.input; - let keymaps = state.setting.keymaps; + let keymaps = new Map(state.setting.keymaps); let matched = Array.from(keymaps.keys()).filter((mapping) => { return mapStartsWith(mapping, input.keys); diff --git a/src/content/reducers/setting.js b/src/content/reducers/setting.js index a54f5a3..a23027f 100644 --- a/src/content/reducers/setting.js +++ b/src/content/reducers/setting.js @@ -1,7 +1,8 @@ import actions from 'content/actions'; const defaultState = { - keymaps: new Map(), + // keymaps is and arrays of key-binding pairs, which is entries of Map + keymaps: [], }; export default function reducer(state = defaultState, action = {}) { diff --git a/test/content/actions/setting.test.js b/test/content/actions/setting.test.js index 0228fea..1248edf 100644 --- a/test/content/actions/setting.test.js +++ b/test/content/actions/setting.test.js @@ -20,8 +20,8 @@ describe("setting actions", () => { } }); let keymaps = action.value.keymaps; - - expect(action.value.keymaps).to.have.deep.all.keys( + let map = new Map(keymaps); + expect(map).to.have.deep.all.keys( [ [{ key: 'd', shiftKey: false, ctrlKey: false, altKey: false, metaKey: false }, { key: 'd', shiftKey: false, ctrlKey: false, altKey: false, metaKey: false }],