puter icon indicating copy to clipboard operation
puter copied to clipboard

Feature Request: Allow apps to determine their initial window dimensions

Open triptych opened this issue 11 months ago • 6 comments

As an app developer I would like to have a way to suggest the window height and width of my app on initial load. Either

  1. in the developer app as part of the config for my app
  2. some way for the app itself to know what it's dimensions are and to be able to resize them on the fly

triptych avatar Mar 12 '24 15:03 triptych

You can already know the app window dimensions but you cannot resize them. Using window.innerWidth and window.innerHeight you can get the size of the window that your app was opened in. I am using these properties to determine the window size in my app. https://puter.com/app/livewinsize

Axorax avatar Mar 12 '24 15:03 Axorax

As @Axorax explained you can get the size of the window. But you're right, you can't resize the window using the SDK. I think this is a good idea, but I need to understand the security/abuse implications (I don't think there are any, but I wonder why browsers don't have it)

jelveh avatar Mar 12 '24 20:03 jelveh

I've seen other implementations where if the size is below or above certain thresholds, they are ignored - this prevents abuse with too large or too small.

triptych avatar Mar 12 '24 23:03 triptych

I would think that it would be okay to resize as long as permission is granted by the user.

On Tue, Mar 12, 2024 at 19:04 Andrew Wooldridge @.***> wrote:

I've seen other implementations where if the size is below or above certain thresholds, they are ignored - this prevents abuse with too large or too small.

— Reply to this email directly, view it on GitHub https://github.com/HeyPuter/puter/issues/81#issuecomment-1992715874, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALVWWUBRXDWDYO2FYTD7STYX6CWDAVCNFSM6AAAAABESPMO3SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJSG4YTKOBXGQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

theEricDevelops avatar Mar 13 '24 00:03 theEricDevelops

I've seen other implementations where if the size is below or above certain thresholds, they are ignored - this prevents abuse with too large or too small.

I think this is the most appropriate implementation.

jelveh avatar Mar 13 '24 01:03 jelveh

I would think that it would be okay to resize as long as permission is granted by the user.

this could work too but I wonder if displaying a dialog asking for resize permission is a little unfamiliar to the user.

jelveh avatar Mar 13 '24 01:03 jelveh