Skip to content
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

🐞 反馈问题:快捷键划词翻译,窗口高度计算有误,出现大片空白 #452

Closed
5 of 6 tasks
tisfeng opened this issue Mar 12, 2024 · 11 comments
Closed
5 of 6 tasks
Assignees
Labels
bug Something isn't working dev

Comments

@tisfeng
Copy link
Owner

tisfeng commented Mar 12, 2024

请先确认以下事项:

  • 请务必查看 常见问题
  • 已仔细阅读了 README
  • issues 页面搜索过问题(包括已关闭的 issue),但未能找到解决方法
  • Easydict 已升级到 最新版本
  • 我理解并认可上述内容,并理解项目维护者精力有限,不遵循规则的 issue 可能会被无视或直接关闭

问题描述

目测是这个 #418 PR 导致,几乎每次都会出现。

iShot_2024-03-12_11.41.02.mp4

该问题是否可以稳定重现?

可重现

重现步骤

截图

image

期望结果

解决方案(可选)

No response

设备型号 && 系统版本

是否愿意提交 PR 解决该问题?

  • 我愿意提交 PR
@tisfeng tisfeng added bug Something isn't working dev labels Mar 12, 2024
@tisfeng
Copy link
Owner Author

tisfeng commented Mar 12, 2024

这个建议 #404 是可以的,但感觉实现方式不是很好,之前测试偶尔会出现 tips view 一闪而过的情况。

这段代码很丑陋,嵌套逻辑太多,容易出问题。

else if ([self isTipsCellRow:row]) {
        if (!self.tipsCell) {
            height = 100;
        } else {
            height = [self.tipsCell cellHeight];
        }
    }

@tisfeng
Copy link
Owner Author

tisfeng commented Mar 12, 2024

每次快捷键划词查询时,会先重置 queryText,可能会导致这里误判。

- (BOOL)isShowTipsView {
    if (Configuration.shared.disableTipsView) {
        return NO;
    }
    if (EZ_isEmptyString(self.queryModel.queryText) && 
        !self.hasShowTips &&
        self.queryModel.actionType != EZActionTypeInputQuery) {
        return YES;
    }
    return NO;
}

@AkaShark
Copy link
Collaborator

okay 我晚点看看这个问题

@tisfeng
Copy link
Owner Author

tisfeng commented Mar 19, 2024

有时候 OCR 截图翻译也会莫名出现 tips view,就很怪。

image

@tisfeng
Copy link
Owner Author

tisfeng commented Mar 19, 2024

如果暂时不能解决,我们可以考虑先 revert 掉这个 feature。

@AkaShark
Copy link
Collaborator

okay 这俩天感冒了,一直没来得及看下,稍后我会看看,如果解决起来比较复杂的话,我先把这个feature revert掉

@tisfeng
Copy link
Owner Author

tisfeng commented Mar 19, 2024

ok,先保重身体。

@AkaShark
Copy link
Collaborator

sorry 最近有点忙... 这个issue 会周末解决下~

@tisfeng
Copy link
Owner Author

tisfeng commented Mar 30, 2024

待修复好这个问题后,你可以用 tips view 优化一下 OCR 错误显示 #478

@tisfeng
Copy link
Owner Author

tisfeng commented Mar 30, 2024

另外,这个错误提示内容可以修改一下,不要使用随机,改成参数指定错误类型,这样方便其他地方使用。

@AkaShark
Copy link
Collaborator

okay

AkaShark added a commit to AkaShark/Easydict that referenced this issue Apr 7, 2024
tisfeng added a commit that referenced this issue May 19, 2024
* Revert "Revert "Feautre tips view (#418)" (#477)"

This reverts commit 11fd868.

* fix: #452 blank for tips view

* feat: add type of tips cell

* feat: support tips cell update cell type

* fix: when  selection translation the text is empty set special tips cell type

* fix: update show tips status

* fix: resolve merge dev

* fix: update action type

* pref: stash ocr error tips

* fix: control show tips code

* fix: update view

* fix: add mini cell height

* fix: tips cell type

* fix: remove unuse code

* fix: called showTipsView when showTips == true

* fix: display when user just want show query window again

* perf: improve displaying tips view

* perf: do not reload tableView when starting query text

* perf: remove unused Localizable.xcstrings

* perf: close tips view when just updating query text

* perf: close tips view when starting OCR image

* chore(deps): bump rexml in the bundler group across 1 directory

Bumps the bundler group with 1 update in the / directory: [rexml](https://github.com/ruby/rexml).


Updates `rexml` from 3.2.6 to 3.2.8
- [Release notes](https://github.com/ruby/rexml/releases)
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md)
- [Commits](ruby/rexml@v3.2.6...v3.2.8)

---
updated-dependencies:
- dependency-name: rexml
  dependency-type: indirect
  dependency-group: bundler
...

Signed-off-by: dependabot[bot] <support@github.com>

* perf(UI): add icon for disableTipsView toggle

* perf(UI): adjust advanced tab height

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Tisfeng <tisfeng@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jerry <89069957+Jerry23011@users.noreply.github.com>
@tisfeng tisfeng closed this as completed May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dev
Projects
None yet
Development

No branches or pull requests

2 participants