Ids should be unique across project
Currently first_id is applied for each top-level object in a project, so ids in different objects within a project overlap. Consider a project that contains a frame and a panel that is to be "stamped" several times in the frame. The panel's ids should not overlap those of the frame or spurious events from the panel will trigger handlers in the frame for which they're inappropriate. An alternative fix is to have an optional first_id property for every top-level object, so the user can control each object's control numbering.
What about using random numbers for ids?
I'd prefer deterministic numbering. The code generator just needs to not restart the sequence when it goes from one top-level object to the next, so they don't overlap.
I just ran into this again today. I'll have to move the frame to a separate project with a different base ID value.