Skip to content

Add AGENTS.md, image paste, Backspace nav, NoDisplay handlers, terminal fix, and media viewer tweaks - #105

Merged
dim-ghub merged 16 commits into
AstraSuite:mainfrom
Better-Than-You:main
Oct 19, 2026
Merged

dim-ghub merged 16 commits into
AstraSuite:mainfrom
Better-Than-You:main

Conversation

@Better-Than-You

Copy link
Copy Markdown
Contributor

Summary

This PR includes the following changes from local development:

Commits

  • Add AGENTS.md project documentation (bd124e4)
  • feat: paste clipboard images as .png files (Dolphin-style) (dac9a8a)
  • feat: go to parent folder with Backspace (db69cea)
  • feat: show NoDisplay handlers in Open With and register whole-MIME-group defaults (8bd698f)
  • fix: launch Terminal=true apps (e.g. micro) inside a terminal emulator (3c75996)
  • fix: media viewer guards and Space shortcut behavior (fb02de7)

Key changes

AGENTS.md (bd124e4)

  • Adds project documentation for future AI agent sessions: build commands (cmake configure/build), installation, directory structure, dependencies, CLI options, CI/CD, conventions, common issues.

Clipboard image paste (Dolphin-style) (dac9a8a)

  • Detect clipboard image data in syncFromSystemClipboard()
  • Add pasteImage() to write non-clobbering image.png / image (n).png files
  • Open rename dialog after pasting
  • Track clipboardImageData and emit clipboardChanged for image-only updates

Navigation (db69cea)

  • Backspace navigates to parent directory in grid, details, and compact views

Open With / MIME handling (8bd698f)

  • Include NoDisplay=true apps in Open With when they explicitly declare matching MIME types
  • Fix desktop entry parsing (proper line-by-line parsing instead of QSettings collapsing values)
  • Fix mimeapps.list reading/writing (proper XDG format handling)
  • Register app for all MIME types it declares when setting as default

Terminal app launching (3c75996)

  • Route Terminal=true desktop entries (e.g. micro) through terminal emulator for Open With and default open
  • Resolve terminal from TERMINAL env var, fallback to common emulators

Media viewer tweaks (fb02de7)

  • Prevent opening non-image/video files in media viewer
  • Require selection for Space key media preview
  • Change Ctrl+Shift+N to create new folder instead of file
  • Update Space key handlers in all view modes (grid/compact/details)

Binary image data on the clipboard was ignored by paste. Clipboard images
are now detected in syncFromSystemClipboard(), and Ctrl+V / the context-menu
Paste action route them through pasteImage(), which writes a non-clobbering
image.png / image (n).png into the current folder and opens the rename
dialog so the user can name it.

- Add clipboardImageData property tracking the clipboard image payload
- Detect and extract image data via imageData(), with explicit mime-type
  fallbacks, stored as base64 PNG
- pasteImage() returns the created path and picks a default name
- syncFromSystemClipboard() emits clipboardChanged for image-only updates
  so canPaste and the menu stay in sync
Compacts Atlas project knowledge for future OpenCode sessions:

- Build commands (cmake configure/build) and installation
- Directory structure and dependencies (Qt 6.5+, CMake 3.19+, Ninja)
- Command-line options, CI/CD workflows, team conventions
- Common issues and development tips
Backspace now navigates to the parent directory in the grid, details and
compact views, matching Dolphin. Handled through the focused view's key
handler so text fields keep their normal Backspace behaviour.
…oup defaults

NoDisplay=true apps (e.g. swappy, which ships NoDisplay=true with
MimeType=image/png;image/jpeg;) were filtered out entirely, so they never
appeared in the Open With dialog even though they are valid handlers for
the selected file type. NoDisplay means "don't show in launchers", not
"not a handler", so NoDisplay entries that explicitly declare the file's
mime type are now included as recommended choices, can be launched via
openWith(), and can be resolved as defaults. Hidden entries stay excluded.

Follow-up fixes:

- Desktop files are parsed line-by-line in the real desktop-entry format;
  QSettings::IniFormat collapsed "MimeType=image/png;image/jpeg;" to
  "image/png" so an app like swappy only ever matched its first MIME type.
- mimeapps.list is read and written by hand in the plain XDG format;
  QSettings percent-escaped group names and backslash-escaped MIME keys,
  producing a file xdg-open silently ignores.
- Setting a default for one file type ("Always use this application...")
  now registers the app for every MIME type it declares in the same group
  (e.g. all image/*), so one click covers all supported extensions instead
  of clobbering an earlier choice for a sibling type.
Desktop entries declaring Terminal=true (like micro.desktop) need a tty:
picking them in Open With launched the raw binary with no tty attached and
nothing appeared to happen, while normal open spammed "/dev/tty: no such
device or address / Fatal: Micro could not initialize a Screen."

- Open With runs Terminal=true entries via the user's terminal emulator
  (TERMINAL env, then foot/kitty/alacritty/...), matching AppIntegration
- Normal open resolves the default app first; Terminal=true defaults are
  routed through MimeService::openWith, everything else keeps the system
  handler via QDesktopServices
- Prevent opening non-image/video files in media viewer
- Require selection for Space key media preview
- Change Ctrl+Shift+N to create new folder instead of file
- Update Space key handlers in all view modes (grid/compact/details)
@dim-ghub

dim-ghub commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Id redo AGENTS.md. If youre going to add documentation, id rather it be for humans under a CONTRIBUTORS.md.

- performSearch walks the tree manually so hidden directories are pruned
  when hidden files are off, and no longer follows directory symlinks
  (avoids Wine-prefix/symlink cycles flooding results)
- search field: '/' is consumed, Enter selects the first match, Up/Down
  hand focus to the results and step the selection, Esc closes the search
  and restores focus while keeping the query
- Backspace in the results (and on an empty search field) closes the
  search filter instead of navigating to the parent directory
- address editor and search bar are mutually exclusive so Ctrl+L during a
  search (or dismissing search with Esc) no longer reveals a stale address
  editor; navigating or switching tabs clears an active search
- Add ShortcutManager C++ singleton (src/core): canonical action
  registry of 39 actions with id/label/category/icon/defaults, user
  overrides persisted as compact JSON under shortcuts/bindings, plus
  conflict detection, reassign, per-action and global reset, and
  key-event -> portable sequence mapping
- Add AppShortcut.qml wrapper: live sequences come from the registry
  and all shortcuts are silenced while the key recorder is open
- Consolidate the ~45 hard-coded Shortcut blocks in main.qml into 39
  AppShortcut actions (merging semantic duplicates like Ctrl+H/Alt+.)
- Add Shortcuts tab to PreferencesModal: searchable, category-grouped
  list with per-row record/add/remove/reset, KeyRecorderDialog with
  bare-key confirmation and conflict replace/cancel flow, and a
  two-step Reset All button
- Fix Ctrl+N default to create a new file (Ctrl+Shift+N/F10 for folder)
- Unit-tested the data layer via a standalone harness: defaults,
  canonicalization, overrides, conflicts, reassign, reset, persistence
Replace our hand-rolled Default/Added-association writer with the more
robust implementation merged upstream (AstraSuite/Atlas PR AstraSuite#104, commit
9f9837d): a plain-XDG MimeappsData model, parseMimeapps/writeMimeapps
helpers, migration of group/key names previously mangled by
QSettings::IniFormat, and Removed Associations handling.

setDefaultApp now reports success (bool) and warns when a per-desktop
* -mimeapps.list shadows the shared file.

Our extra behaviour is preserved on top of it:
- desktop entries are still parsed by hand so multi-valued MimeType
  fields are not collapsed by QSettings
- NoDisplay handlers (e.g. swappy) still appear in Open With and can be
  resolved as defaults
- setting a default still registers the whole MIME group the app
  declares
- Terminal=true entries are still launched in a terminal emulator
Double-clicking a file handed it to QDesktopServices/xdg-open, which pops
up the "choose an application to open this file" chooser whenever the
association lives only in [Added Associations] or the desktop handler
cache is stale, even though Atlas resolves a working handler. Open With
was unaffected because it launches the app directly via MimeService.

openWithDefault now resolves the default handler through MimeService and
launches it with MimeService::openWith (which also covers Terminal=true
entries), falling back to QDesktopServices only when no handler is known.
Add a "Drag to Scroll" preference (persisted as session/dragToScroll)
that swaps the mouse buttons used for rubber-band selection and panning
in the grid, compact and details views:

- enabled:  left-drag scrolls, right-drag rubber-band selects
- disabled: left-drag selects, right-drag scrolls (previous behaviour)

Each view's background MouseArea now derives selectButton/scrollButton
from the setting, tracks a separate scroll drag alongside the existing
selection drag, and suppresses the follow-up click for either gesture so
a plain press still deselects (left) or opens the context menu (right).
Previously a drag that started on any item was captured by the item's
MouseArea, which always started a native file drag. So with Drag to
Scroll on, dragging over an item dragged the file instead of scrolling,
and right-drag over an item opened the context menu instead of selecting.

The background MouseArea's gesture logic is now exposed as
beginGesture/updateGesture/endGesture, and item delegates forward their
drag to it whenever the pressed item is *not* selected. An item that is
already selected keeps the gesture and is dragged away as before.

Result:
- nothing selected: dragging over items scrolls (scroll button) or
  rubber-band selects (select button), with the rubber band drawn from
  the press point
- selection exists: dragging a selected item moves it, nothing else
The band visual and the item selection were computed in different
coordinate spaces:

- Details: listView is nested inside the horizontal Flickable's
  ColumnLayout, so listView.y is not in the drag area's space. Convert
  points through mapToItem/mapFromItem instead of subtracting listView.y.
  Also use root.rowHeight instead of a hard-coded 36 so taller rows
  (higher zoom) still line up.
- Compact/Grid: GridView lays items out inside
  (size - leadingMargin - trailingMargin), so the inset must be applied
  when mapping indices to cells or the row/column count is off by one.

Also fixed the auto-scroll edge thresholds in the details view, which
used the same incorrect listView.y.
# Conflicts:
#	src/core/mimeservice.cpp
@dim-ghub
dim-ghub merged commit 72e1741 into AstraSuite:main Oct 19, 2026
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.

2 participants