Skip to content

Open a page's new tab beside the page that opened it - #295

Merged
yansfil merged 4 commits into
mainfrom
browser-tab-beside
Oct 1, 2026
Merged

yansfil merged 4 commits into
mainfrom
browser-tab-beside

Conversation

@yansfil

@yansfil yansfil commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Related: #282

Summary

브라우저 디스플레이에서 GitHub 본문 이미지처럼 target=_blank로 감싼 링크를 누르면, 새 탭이 같은 영역에 생겨 바로 앞으로 와서 원래 페이지가 이미지로 바뀐 것처럼 보였습니다.
이제 페이지가 연 새 탭은 그 페이지 옆에 열립니다: 옆 View 영역이 있으면 그 영역의 새 탭으로, 없으면 오른쪽에 새 영역을 만들어서. 원래 페이지는 그대로 화면에 남습니다.
셸이 browser_open에 연 페이지(beside_display)를 넘기고, core가 Open to the side와 같은 순서(오른쪽, 왼쪽, 아래, 위)로 자리를 고릅니다.
이미 보이는 주소면 그 디스플레이를 다시 보여 주고, 연 페이지가 닫혔으면 예전처럼 사용 중인 영역에 엽니다. 시프트 클릭과 features 없는 window.open도 같습니다.

이미지 링크를 누른 뒤: 왼쪽 원래 페이지는 그대로, 오른쪽 새 영역에 이미지

Review

  • 판단해 주세요: 오른쪽 영역에 있는 페이지가 새 탭을 열면 순서상 왼쪽 영역으로 가서, 거기 앞에 있던 것(원래 PR 페이지, 파일, diff)을 가립니다. 지금은 문서 Open to the side와 같은 규칙.
  • 조심해서 볼 파일: herdr-core/src/runtime/view_areas.rs - runtime mutex 안의 change_view_layout 클로저. 새 분기는 insert/split_new만 쓰고 상한 검사는 기존 그대로.

Evidence

  • 확인한 것: core 테스트 1082개 통과. 새 테스트가 첫 탭은 오른쪽 새 영역, 다음 탭은 그 영역, 같은 주소는 포커스, 닫힌 페이지는 사용 중 영역임을 확인.
  • 확인한 것: desktop e2e browser 5개 통과. 시프트 클릭 뒤 원래 페이지와 새 페이지가 둘 다 화면에 보이는지 네이티브 뷰 기준으로 확인.
  • 확인한 것: web vitest 734개, clippy, fmt 통과. 격리된 dev 빌드에서 이미지 링크를 실제로 눌러 위 화면을 캡처.
  • 확인하지 못한 것: 원격 SSH 기기 Workspace에서의 배치 (remote-workspace e2e는 로컬에서 건너뜀). 코드상 같은 core 경로.
  • 확인하지 못한 것: 셸의 open 이벤트가 beside_display를 싣는 것을 단위 테스트로는 따로 확인하지 않음 (e2e가 결과로 확인).

A target=_blank link (an image a page wraps in one), a shift-click, or a
window.open without features opened another browser display in the active
area and brought it to the front, so the page that asked seemed to turn into
the image. The shell now names the opening page in browser_open
(beside_display), and the core places the new display in the View area next
to that page's area in Open to the side's order, else in a new area to its
right, so the page stays in view. With no room for another area, or with the
page gone, it opens where any page would.
…s placement in tests

A page whose area has no neighbour holds the only area, so a split beside it always fits the area cap and only the display cap can refuse it, which a plain insert would hit too. The test now covers an address already shown and where a tab from a closed page lands, and the docs say what the code does.
…screen

At the 1024-point window a runner's screen holds, the side panel shows one View area until it is expanded, as the first browser test does; the popup test now sizes its window the same way and expands the panel before it checks that the page and its new tab both show.
@yansfil
yansfil merged commit 380c994 into main Oct 1, 2026
16 checks passed
@yansfil
yansfil deleted the browser-tab-beside branch October 1, 2026 15:12
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.

1 participant