Skip to content

fix: resizing window discards edits in compose editors#2719

Merged
kmendell merged 1 commit into
mainfrom
fix/resizing-window
May 23, 2026
Merged

fix: resizing window discards edits in compose editors#2719
kmendell merged 1 commit into
mainfrom
fix/resizing-window

Conversation

@kmendell
Copy link
Copy Markdown
Member

@kmendell kmendell commented May 23, 2026

Checklist

  • This PR is not opened from my fork’s main branch

What This PR Implements

Fixes: #2660

Changes Made

Testing Done

  • Development environment started: ./scripts/development/dev.sh start
  • Frontend verified at http://localhost:3000
  • Backend verified at http://localhost:3552
  • Manual testing completed (describe):
  • No linting errors (e.g., just lint all)
  • Backend tests pass: just test backend

AI Tool Used (if applicable)

AI Tool:
Assistance Level:
What AI helped with:
I reviewed and edited all AI-generated output:
I ran all required tests and manually verified changes:

Additional Context

Disclaimer Greptiles Reviews use AI, make sure to check over its work.

To better help train Greptile on our codebase, if the comment is useful and valid Like the comment, if its not helpful or invalid Dislike

To have Greptile Re-Review the changes, mention greptileai.

Greptile Summary

This PR fixes the bug where resizing the browser window would discard in-progress edits in compose editors. The root cause was that the IsTablet breakpoint hook triggered conditional rendering ({#if isTablet.current}), causing CodePanel (and its embedded CodeEditor) to be destroyed and re-created on viewport changes, losing unsaved content.

  • CodePanel.svelte: The {#if effectiveAutoHeight} ... {:else} branching that mounted two separate CodeEditor instances is replaced with a single always-mounted CodeEditor wrapped in a <div> whose class changes between '' and 'absolute inset-0' — the editor survives layout switches intact.
  • resizable-split.svelte: A new stackBelow prop lets the split panel switch to a stacked (flex-col) layout below a given pixel width, using a ResizeObserver + window resize listener to track changes without destroying child content.
  • +page.svelte: Duplicate tablet-specific layouts using IsTablet are removed; both the tree and classic modes now use a single ResizableSplit with stackBelow={1024} to handle responsive behaviour.

Confidence Score: 5/5

Safe to merge — the change eliminates editor re-mounting on resize without introducing new correctness issues.

The fix correctly targets the root cause: conditional rendering was destroying and recreating the CodeEditor on viewport changes. Replacing the {#if} branch with a single always-mounted editor wrapped in a style-toggling div is the right approach. The new stackBelow responsive logic in resizable-split.svelte is correctly scoped to onMount and event handlers, cleanup is handled, and applySize is now called on both transition directions. No new data-loss, auth, or runtime-error risks are introduced.

No files require special attention.

Reviews (2): Last reviewed commit: "fix: resizing window discards edits in c..." | Re-trigger Greptile

@kmendell kmendell marked this pull request as ready for review May 23, 2026 21:25
Copy link
Copy Markdown
Member Author

kmendell commented May 23, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@kmendell kmendell requested a review from a team May 23, 2026 21:25
@getarcaneappbot
Copy link
Copy Markdown
Contributor

getarcaneappbot commented May 23, 2026

Container images for this PR have been built successfully!

  • Manager: ghcr.io/getarcaneapp/manager:pr-2719
  • Agent: ghcr.io/getarcaneapp/agent:pr-2719

Built from commit ba491ee

Comment thread frontend/src/lib/components/resizable-split.svelte Outdated
Comment thread frontend/src/lib/components/resizable-split.svelte
@kmendell kmendell force-pushed the fix/resizing-window branch from 0af76d5 to 001d423 Compare May 23, 2026 21:58
@kmendell kmendell force-pushed the fix/resizing-window branch from 001d423 to ba491ee Compare May 23, 2026 22:10
@kmendell kmendell merged commit f201e6b into main May 23, 2026
26 checks passed
@kmendell kmendell deleted the fix/resizing-window branch May 23, 2026 22:25
github-actions Bot added a commit to ShobuPrime/home-assistant-apps that referenced this pull request May 26, 2026
## Arcane Docker Manager Update

This automated PR updates Arcane from `1.19.4` to `1.19.5`.

### Changelog


### Bug fixes

* improve environment proxy error handling ([#2649](getarcaneapp/arcane#2649) by `kmendell`)
* align local BuildKit load/push exporter ([#2650](getarcaneapp/arcane#2650) by `kmendell`)
* PUID and PGID being set on project subfolder on every startup ([#2656](getarcaneapp/arcane#2656) by `kmendell`)
* system upgrade doesnt support non unix socket docker hosts ([#2651](getarcaneapp/arcane#2651) by `kmendell`)
* resizing window discards edits in compose editors ([#2719](getarcaneapp/arcane#2719) by `kmendell`)
* only validate project name if it has changed ([#2720](getarcaneapp/arcane#2720) by `kmendell`)
* make Arcane reverse-proxy aware to resolve connection issues ([#2717](getarcaneapp/arcane#2717) by `kmendell`)
* tolerate undefined typed env vars in GitOps sync ([#2721](https://github.com/getarcaneapp/arcane/pu

### Changes

- Updated `config.yaml` version
- Updated `build.yaml` ARCANE_VERSION
- Updated `Dockerfile` ARCANE_VERSION
- Updated documentation files
- Updated CHANGELOG.md

### Release Notes

Full release notes: https://github.com/getarcaneapp/arcane/releases/tag/v1.19.5

---

This PR was automatically generated by the Update Arcane workflow

Auto-merged by GitHub Actions
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.

🐞 Bug: Edits in project configuration (.yaml and .env) resets when changing window size

2 participants