Skip to content

feat(query): support collapsing the input text field - #1357

Open
nbasov wants to merge 5 commits into
tisfeng:devfrom
nbasov:feat/collapsible-input-field
Open

nbasov wants to merge 5 commits into
tisfeng:devfrom
nbasov:feat/collapsible-input-field

Conversation

@nbasov

@nbasov nbasov commented Oct 11, 2026 •

Copy link
Copy Markdown

背景 / Context

When Window Configuration → Show Input Text Field is enabled, the input (source text) block cannot be collapsed. For users who mostly translate selected text, the source text is already visible in the original app, so the huge input block takes up window space for no benefit.

Goal: let users collapse the input block the same way as result blocks, and remember that choice for select-text translation.

变更内容 / Changes

  • Collapse control: added an arrow button at the bottom-right of the input block's button bar. The clear button now sits to its left. It uses the same arrow-down / arrow-left icons and the existing show / hide tooltips as the result view, so no new localized strings are needed. When collapsed, the text area is hidden and only the button bar remains.

  • Persistence scope: the collapsed state is saved per window type in Defaults (EZConfiguration_kInputFieldCollapsedKey_<windowType>), but only for select-text translation:

    • auto select (mouse selection / pop button)
    • shortcut select
    • invoke queries via URL scheme (PopClip, macOS Services, CLI -q)

    Other actions (input translate, OCR, pasteboard translate, etc.) always open the block expanded. Toggling it there lasts only for the current session and does not change the saved preference.

  • Auto-expand: typing or pasting while the block is collapsed expands it, so input is never invisible. At that point the action type has become an input query, so the saved select-text preference is not overwritten.

  • Layout fixes:

    • EZQueryView reports its row height via heightOfQueryView, which takes the collapsed state into account. Previously the collapsed block grew to the text height when a new window opened with selected text.
    • The scroll view is not pinned to the top while collapsed, to avoid constraint conflicts with the button bar.
  • Window position: EZWindowManager now updates the action type before computing the floating window location, so a height change from restoring the collapsed state does not shift the window's top edge.

Files: EZQueryView.{h,m}, EZBaseQueryViewController.m, EZWindowManager.m, Configuration+Extension.swift, Defaults.Keys+Extension.swift.

关联 Issue / Linked Issues

Didn't found

验证 / Verification

  • xcodebuild build (Debug, Xcode 26.3, macOS 15.8.1): succeeded. On the local machine, the asset catalog .icon export step fails with Icon export exited with status 255, an environment issue unrelated to this change. The build was therefore run with 'EXCLUDED_SOURCE_FILE_NAMES=*.icon' ASSETCATALOG_COMPILER_APPICON_NAME=AppIcon. No new warnings in changed files.
  • git diff --check: passed.
  • Manual check on a local Debug build:
    • toggling collapse / expand in the fixed and mini windows
    • the collapsed state restored for select-text translation, including after reopening the window
    • input translate opens expanded
    • typing while collapsed auto-expands
  • No automated tests added.

截图 / Screenshots

Before
Screenshot 2026-10-10 at 14 32 21

After
image

Screenshot 2026-10-11 at 15 36 22 Screenshot 2026-10-11 at 15 35 44

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello nbasov, Thank you for your first PR contribution 🎉 nbasov

@nbasov
nbasov marked this pull request as ready for review October 11, 2026 14:38
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T19:49:41.475655Z 196009b New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Issues-translate-bot

Copy link
Copy Markdown

Bot automatically translated this content.


法典审查摘要

此评论显示了针对此拉取请求的最新法典审查活动。

评论 状态 提交 审查触发器
📝 代码审查 🔄 **自 2026-10-11T14:38:12.598588Z 开始运行** c05aa77 草案标记为准备就绪
ℹ️ 关于 GitHub 中的 Codex

您的团队已设置 Codex 来审查此存储库中的拉取请求。 当您

  • 打开拉取请求以供审核
  • 将草稿标记为就绪
  • 评论“@​codex review”或“@​codex security review”。

当任何审查正在进行时,Codex 会以 👀 做出反应,如果有建议则进行评论,并在所有审查结束且没有发现结果时以 👍 做出反应。

</详情>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c05aa771c0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@nbasov
nbasov force-pushed the feat/collapsible-input-field branch from 5c18b55 to e23e11a Compare October 13, 2026 20:25
nbasov and others added 2 commits October 13, 2026 22:28
Add a collapse arrow to the bottom-right of the input field's button
bar (the clear button sits to its left), matching the result view's
arrow. When collapsed, the text area is hidden and only the button bar
stays visible; typing or pasting while collapsed expands it again.

The collapsed state is persisted per window type, but only for
select-text translation: auto select, shortcut select, and invoke
queries from PopClip / macOS Services via URL scheme. Other actions
(input, OCR, pasteboard, etc.) always start expanded, and toggling
there only lasts for the current session.

- EZQueryView reports its height via heightOfQueryView so a collapsed
  field no longer grows when a new window is shown with selected text,
  and the scroll view is not pinned to the top while collapsed to avoid
  constraint conflicts with the button bar.
- EZWindowManager updates the action type before computing the window
  location, so a collapsed-state height change does not shift the
  window's top edge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Query in App on the current or a pinned window calls
startQueryText:actionType: directly, so an invoke query did not restore
the saved collapsed state, and swapping translation languages re-queried
as input query without expanding the field. Apply the collapsed state
there when the action type changes, keeping session-only toggles for
same-type re-queries.

OCR actions keep the current collapsed state, both when the window is
shown and after OCR finishes. The OCR loading view keeps two constraint
sets: anchored to the text view when expanded, and placed in the button
bar right after the copy button, or the detect language button when it
is visible, when collapsed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nbasov
nbasov force-pushed the feat/collapsible-input-field branch from e23e11a to 5af4fa9 Compare October 13, 2026 20:30

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5af4fa9dd8

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 24a0a9de83

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

nbasov and others added 2 commits October 26, 2026 20:21
The dev merge brought in tisfeng#1327, which dropped the animated row-update
API in favor of immediate row layout with window-only animation. Use
updateQueryCell for both input-field collapse paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 196009b513

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants